Page 1 of 1

gs: not found

Posted: 2008-10-29T13:39:31-07:00
by James.Riendeau
ImageMagick works fine from the command line to convert a PDF to a PNG, but from a perl script, I see this in the Apache2 logs:

[Date/Time] [error] [client 123.456.789.999] gs: not found, referer: https://domain.com/path/to/script.pl

I'm running FreeBSD 7, perl 5.8.8, Ghostscript 8.62, and ImageMagick 6.4.4.

Any idea what is wrong?

Re: gs: not found

Posted: 2008-10-29T14:04:20-07:00
by magick
It looks like Ghostscript (gs) is not in the execution path of your script. You can set the $ENV['PATH'] variable and include the path (e.g. /usr/local/bin).

Re: gs: not found

Posted: 2008-10-29T14:27:48-07:00
by James.Riendeau
Thanks for the hint. :D

The final solution was to add the following:

Code: Select all

use Image::Magick;
$ENV{'PATH'} .= ':/usr/local/bin';

Re: gs: not found

Posted: 2008-10-29T15:21:46-07:00
by magick
Another solution is to set the absolute path of gs in the delegates.xml configuration file. Instead of "gs" use, for example, "/usr/local/bin/gs".