osx - How to get a shell command to work in php with exec -
when run in terminal:
convert file.pdf file.png everything works fine, when in php script as:
exec('convert file.pdf file.png'); i errors. when search online how solve these errors end making subtle changes files here, , permissions there. errors change , have no idea how got am. feel though chasing phantom.
i don't know whether problem lies imagemagick, php, ghostscript, permissions, etc.
so question is: how should go can re-attack problem beginning? need reinstall things? if so, , on order? should have permissions?
i appreciate question rather open, judging multitude of similar questions, sorts of different answers, have clear definite checklist work through.
for completeness using mac osx, yosemite; php 5.5.27; imagemagick 6.9.1-10; gs 9.16 , present error says:
convert: no images defined `file.png' @ error/convert.c/convertimagecommand/3230. i using full path names convert , files too.
with 'shell_exec' more error messages:
dyld: library not loaded: /usr/local/lib/libtiff.5.dylib referenced from: /usr/local/bin/gs reason: incompatible library version: gs requires version 8.0.0 or later, libtiff.5.dylib provides version 6.0.0 convert: failedtoexecutecommand `"gs" -q -dquiet -dsafer -dbatch -dnopause - dnoprompt -dmaxbitmap=500000000 -daligntopixels=0 -dgridfittt=2 "-sdevice=pngalpha" -dtextalphabits=4 -dgraphicsalphabits=4 "-r300x300" "-soutputfile=/var/tmp/magick-9254642riqmo2cuwm%d" "-f/var/tmp/magick-92546j8posqiirra3" "-f/var/tmp/magick-92546lb13giwos7rr"' (-1) @ error/delegate.c/externaldelegatecommand/483. convert: no images defined `file.png' @ error/convert.c/convertimagecommand/3230.
note php's shell_exec takes string argument:
shell_exec('convert file.pdf file.png');
Comments
Post a Comment