ImageMagick error code 127

Good point mingrone.

Here's the code inside im2.php:

Code:
<html> <head> <title>Test for ImageMagick</title> </head>
<body> <?
function alist ($array) {  //This function prints a text array as an html list.
  $alist = "<ul>";
  for ($i = 0; $i < sizeof($array); $i++) {
    $alist .= "<li>$array[$i]";
  }
  $alist .= "</ul>";
  return $alist;
}
exec("convert -version", $out, $rcode); //Try to get ImageMagick "convert" program version number.
echo "Version return code is $rcode 
"; //Print the return code: 0 if OK, nonzero if error.
echo alist($out); //Print the output of "convert -version"

?> </body> </html>

Thanks for any assistance.
 
SOLVED: for FreeBSD users wanting to use ImageMagick in their php scripts, here's what I did to get this to work in this order:

1) update ALL the ports. I used the portsnap method (my ports were way out of date!)
2) update/install libtool port - v2.2 (very important but be careful because apparently other ports depend on libtool and if you botch it, you might create problems. Mine went smoothly)
3) update/install ImageMagick port - v6.6.6
4) update/install pecl-imagick port - v3.0.1 (this gave me a bit of a headache as the checksum was wrong so I manually put the latest version from http://pecl.php.net/package/imagick into the directory the error code told me to add it in)
5) restart machine

That did the trick. Interestingly enough ImageMagick forums didn't provide any answers at all. I would have thought I would find a nice easy tutorial to get IM working on FreeBSD with php but nada. Everyone kept referencing Linux but that doesn't help us.

Hope this saves someone some time and frustration!

Cheers,

Angelo
 
Back
Top