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?
gs: not found
Re: gs: not found
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
Thanks for the hint.
The final solution was to add the following:
The final solution was to add the following:
Code: Select all
use Image::Magick;
$ENV{'PATH'} .= ':/usr/local/bin';
Re: gs: not found
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".