Page 1 of 1

imagick can't find ghostscript in Windows

Posted: 2012-08-11T07:20:03-07:00
by dan2
I am having lots of trouble with the imagick plugin on my 32-bit Windows 2003 server. I did my development on a Linux machine where everything was simple and easy, but, unfortunately my target production machine is a Windows / IIS box.

ImageMagick itself works flawlessly from the command line.

And imagick works fine in PHP except when I go to read from a PDF. For whatever reason, it won't find ghostscript. I have my ghostscript bin folder in the path, and in the registry.

HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\9.05\GS_DLL = C:\Program Files\gs\gs9.05\bin\gsdll32.dll
HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\9.05\GS_LIB = C:\Program Files\gs\gs9.05\bin;C:\Program Files\gs\gs9.05\lib;C:\Program Files\gs\gs9.05\fonts

From my understanding, the registry key is where imagick looks when it's searching for ghostscript.

Anyway, when I attempt to create a png thumbnail from a PDF file, I get this error:

Fatal error: Uncaught exception 'ImagickException' with message 'Postscript delegate failed `uploads/Report A Yates 01H.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/678'

I suppose I could rewrite all of my code to use exec() and use the command line tools, but I would rather not if I didn't have to.

Here are the versions of the relevant software:

Ghostscript 9.05
ImageMagick 6.7.8-6 2012-07-21 Q16
PHP 5.3.6 (installed via Windows Web Platform Installer)
imagick -- downloaded from here: valokuva dor org slash builds
Windows Server 2003 R2 (32-bit)
IIS 6.0

Re: imagick can't find ghostscript in Windows

Posted: 2012-09-09T12:54:01-07:00
by tk1
Hi dan2!

Are you aware of Imagick relative paths bug? (see bugs: #61583 and #59594).
Does IIS_USR and IIS_WAM have read and execute rights to the ImageMagick files?
Does IIS_USR and IIS_WAM have read and execute rights to the Ghostscript files?

When I installed GS and then ImageMagick then I was able process PDF files with no configuration.