Page 1 of 1

sh: gs: command not found identify: Postscript delegate fail

Posted: 2010-10-06T02:06:34-07:00
by redaware
Hi to all...

I have been struggling to get PHP to execute imagemagick commands to convert pdf to png and I have been trawling the net for days trying to figure out a solution; to no avail.

I have ghostscript installed and working and imagemagic is also working correctly.

The funny thing is that it is working perfectly in command line via ssh but as soon as I run the command through a browser then I get the following message:

sh: gs: command not found
identify: Postscript delegate failed `xxxx.pdf': @ error/pdf.c/ReadPDFImage/645.

I have executed the same the PHP page through command line and it works perfectly, it only throws the above error when it is executed via a browser.

I have tried editing the delegates.xml file to include the absolute path to gs, but as soon as I do that I get another error; see below:

sh: line 1: -f/tmp/magick-XX4U9pFb: No such file or directory
identify: Postscript delegate failed `xxxx.pdf': @ error/pdf.c/ReadPDFImage/645.

If I then change the delegates file back to what is was I get the following error:
sh: gs: command not found
sh: line 1: -f/tmp/magick-XXy47czr: No such file or directory
identify: Postscript delegate failed `xxxx.pdf': @ error/pdf.c/ReadPDFImage/645.

I then have to re-install im to get it to go away...

Both im and gs are installed in the same directory.

I think that's it for now...