ImageMagick is installed (Leopard) but does not work
Posted: 2009-07-27T01:24:38-07:00
Dear forum,
I just installed ImageMagick on Mac OS X Leopard. When I open the terminal and type convert -version I get the version number 6.5.4-0, so it's installed. convert -v also works.
But when I run this code in PHP I get a 127 error, and the jpg image is not converted. It works if I type convert mac_mini.jpg mac_min.png in the terminal.
Can someone please tell me what the problem is?
I just installed ImageMagick on Mac OS X Leopard. When I open the terminal and type convert -version I get the version number 6.5.4-0, so it's installed. convert -v also works.
But when I run this code in PHP I get a 127 error, and the jpg image is not converted. It works if I type convert mac_mini.jpg mac_min.png in the terminal.
Code: Select all
<?php
exec("convert -version", $out, $rcode); //Try to get ImageMagick "convert" program version number.
echo "Version return code is $rcode <br>"; //Print the return code: 0 if OK, nonzero if error.
echo alist($out); //Print the output of "convert -version"
$exec = "convert mac_mini.jpg mac_mini.png";
exec($exec, $yaks);
print_r ($yaks);
?>