Page 1 of 1

Postscript delegate failed

Posted: 2010-01-28T05:40:23-07:00
by youds
Hi

I'm having problems with ImageMagick / iMagick using Zend Server Community Edition Version 4.0.6 (PHP 5.3 on Mac OS X 10.6)

From phpinfo():
- imagick module version 2.2.2
- ImageMagick 6.3.7
- ImageMagick Number of supported formats: 165

From CLI:

Code: Select all

craig-fairhursts-computer:Desktop youdsmedia$ gs -v
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
craig-fairhursts-computer:Desktop youdsmedia$ convert -version
Version: ImageMagick 6.5.9-0 2010-01-27 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP OpenCL 

craig-fairhursts-computer:Desktop youdsmedia$ convert 396677.pdf image.jpg
craig-fairhursts-computer:Desktop youdsmedia$ ls /usr/local/zend/apache2/bin/
ab		apxs		envvars-std	htdigest	logresolve
apachectl	checkgid	gs		htpasswd	rotatelogs
apr-1-config	dbmmanage	htcacheclean	httpd
apu-1-config	envvars		htdbm		httxt2dbm
craig-fairhursts-computer:Desktop youdsmedia$
With the above setup, I get this error:
Fatal error: Uncaught exception 'ImagickException' with message 'Postscript delegate failed `/Users/youdsmedia/Sites/panaz/1.0.4a/admin/tmp/newpdf2.pdf': No such file or directory' in /Users/youdsmedia/Sites/panaz/1.0.4a/admin/includes/common/fpdi/pdf.php:54 Stack trace: #0 /Users/youdsmedia/Sites/panaz/1.0.4a/admin/includes/common/fpdi/pdf.php(54): Imagick->__construct('../../../tmp/ne...') #1 {main} thrown in /Users/youdsmedia/Sites/panaz/1.0.4a/admin/includes/common/fpdi/pdf.php on line 54

Here's the code:

Code: Select all

$im = new Imagick('newpdf2.pdf' ); 

$im->setImageColorspace(255);
$im->setCompression(Imagick::COMPRESSION_JPEG);
$im->setCompressionQuality(100);
$im->setImageFormat('jpeg');
// Output the image
$output = $im->getimageblob();
$outputtype = $im->getFormat();

header("Content-type: $outputtype");
echo $output;
$im->clear();
$im->destroy();
I've searched all over the place for a solution. I had the same problem from command line when GhostScript wasn't installed, but from PHP it doesn't appear to know where or how to call GhostScript even though installed on CLI. As you can see from above, I've copied over the "gs" script into the apache2 bin so the script is present, and should be in Apache's Environment path. However the error says "GhostScript not installed" to me.

Any advice?

Re: Postscript delegate failed

Posted: 2010-02-04T07:59:49-07:00
by youds
I found out that the .so I was using was the incorrect version.
Ended up giving up on Zend Server, as the compiled extensions were for old versions. I switched to CentOS with a DirectAdmin installation run locally.