Certain commands executed via PHP shell fail

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
davidenco
Posts: 2
Joined: 2015-08-15T01:42:36-07:00
Authentication code: 1151

Certain commands executed via PHP shell fail

Post by davidenco »

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.

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
I need to convert a PDF to an image as follows:

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');
?>
However the output from this command is:

Code: Select all

Unknown device: pamcmyk32
Unrecoverable error: undefined in .uninstallpagedevice Operand stack:
    defaultdevice
If I execute the exact same command via SSH, it works! But why?!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Certain commands executed via PHP shell fail

Post by snibgo »

Is it running the same version of Ghostscript?
snibgo's IM pages: im.snibgo.com
davidenco
Posts: 2
Joined: 2015-08-15T01:42:36-07:00
Authentication code: 1151

Re: Certain commands executed via PHP shell fail

Post by davidenco »

Yes, Ghostscript didn't change throughout the different ImageMagick versions.
Post Reply