Errors when used from PHP, not from Terminal?
Posted: 2011-01-11T05:19:38-07:00
I have a script that is supposed to take the first page of a PDF file and generate a thumbnail of it.
I'm running ImageMagick 6.6.5-0 2010-10-14 Q16 on a CentOS system, and I have Ghostscript installed also.
The weird thing is, the command doesn't work when run from within PHP's exec() function. The error messages returned are:
Yet when I run the same command directly from a shell window (logged in as the relevant user) the command works fine.
The command being executed is:
I'm running ImageMagick 6.6.5-0 2010-10-14 Q16 on a CentOS system, and I have Ghostscript installed also.
The weird thing is, the command doesn't work when run from within PHP's exec() function. The error messages returned are:
Code: Select all
convert: no decode delegate for this image format `/tmp/magick-XX0ORHI2' @ error/constitute.c/ReadImage/532.
convert: missing an image filename `jpg:/home/sfocus/public_html/test.jpg' @ error/convert.c/ConvertImageCommand/2946.
The command being executed is:
Code: Select all
/usr/local/bin/convert -colorspace RGB -thumbnail "106x150>" "/home/sfocus/public_html/assets/back_issues/2010/2010_07.pdf[0]" miff:- | /usr/local/bin/composite -compose Over -gravity "Center" - -size "106x150" "xc:#FFFFFF" miff:- | /usr/local/bin/convert -thumbnail "106x150>" - jpg:-