gs: not found

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
James.Riendeau

gs: not found

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: gs: not found

Post 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).
James.Riendeau

Re: gs: not found

Post 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';
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: gs: not found

Post 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".
Post Reply