I have used a docker container with the embedded php
server for development. Now we are creating a test environment and we wanted to use php-fpm
. Everything went fine and the whole thing works as expected, with one difference - ImageMagick.
The same command, executed from php
embedded server and php-fpm
yields different results:
When converting images using the embedded server it works just fine, but when using php-fpm
, I get:
convert: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/504.
convert: no images defined `-' @ error/convert.c/ConvertImageCommand/3258.
It's really frustrating because it's the same container, the same php
installation, the same php.ini.
EDIT: Command used:
shell_exec("/usr/bin/convert -thumbnail "50x50+0+0" /app/assets/uploads/super_e55d4fbf182b582f5bb1_bottle05.png -");
EDIT2: I have tried executing something "simple", and here's the output:
shell_exec("/usr/bin/identify");
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org[...]
shell_exec("ls /app/assets/uploads/super_e55d4fbf182b582f5bb1_bottle05.png");
/app/assets/uploads/super_e55d4fbf182b582f5bb1_bottle05.png
shell_exec("/usr/bin/identify /app/assets/uploads/super_e55d4fbf182b582f5bb1_bottle05.png");
null
EDIT3:
shell_exec("/usr/bin/identify /app/assets/uploads/super_e55d4fbf182b582f5bb1_bottle05.png 2>&1");
identify-im6.q16: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/504.
while executed directly in shell:
/usr/bin/identify /app/assets/uploads/super_e55d4fbf182b582f5bb1_bottle05.png 2>&1
/app/assets/uploads/super_e55d4fbf182b582f5bb1_bottle05.png PNG 520x1020 520x1020+0+0 8-bit sRGB 319KB 0.010u 0:00.009