Certain commands executed via PHP shell fail
Posted: 2015-08-17T00:54:08-07:00
This issue occurs with versions 6.9.1-6, 6.9.1-7, 6.9.1-8, 6.9.1-9 and 6.9.1-10. The problem does not occur with 6.9.1-4.
I need to convert a PDF to an image as follows:
However the output from this command is:
If I execute the exact same command via SSH, it works! But why?!
Code: Select all
CentOS 6.7 x64
PHP 5.5.28
GPL Ghostscript 9.16 (2015-03-30)
ImageMagick 6.9.1-6 Q16 x86_64 2015-06-25
Code: Select all
<?php
echo shell_exec('/usr/local/bin/convert -density 300 /path/to/file.pdf -resize 25% -compress lossless -quality 0 /path/to/file.jpg');
?>
Code: Select all
Unknown device: pamcmyk32
Unrecoverable error: undefined in .uninstallpagedevice Operand stack:
defaultdevice