I have installed ImageMagick on Windows 10. I can use it successfully from the command line to convert pdf to tiff or jpeg. If I try to use it from a php web page on the machine's Default Web Site via shell_exec() call it fails with the error message:
magick.exe: PDFDelegateFailed `[ghostscript library 9.27] -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" "-sOutputFile=C:/Windows/TEMP/magick-10805W5t4T7R2ln8%d" "-fC:/Windows/TEMP/magick-10805T5PwK17wS3B" "-fC:/Windows/TEMP/magick-1080MMkVWJeXr8bF": (null)' @ error/pdf.c/ReadPDFImage/980.
<?php
$output=shell_exec('"C:\ImageMagick\magick" -density 300 "input.pdf" "out.tiff" 2>&1');
echo "<pre>$output</pre>";
?>
hopefully helpful:
-shell_exec() is working in other contexts (runs other .exe files mkdir..)
-I have given IUSR_xxxx (Internet Guest Account) permission to run magick.exe.
-the full pathname => "C:\ImageMagick\magick"
PHP Version 7.2.14
IIS version 1903(OS Build 18362.239)
ImageMagick-7.0.8-53-Q16
GPL Ghostscript 9.27 (2019-04-04)
Any ideas what the issue might be?