DevReview.net

More development notices …

Archive for the ‘imagemagick’ tag

PHP exec() returns error 127

leave a comment

Today I had one strange error between php and freeBSD, throught exec() function. Had to debug for 2 hours.
User passed correct. `whoiam` returned right data. Some other shell commands like `ls -al`, `pwd` worked well. With same user direct command to shell worked correct.

but:
$command = "identify -format '%m' " . $src;
exec($command, $output, $result);

$result returned (int)127 error.
$output – empty.

Btw, `identify` is part of installed imagemagick’s application.

The problem was – php can’t find application `identify`. Dunno why even till now. So, full path works OK.

$command = "/usr/local/bin/identify -format '%m' " . $src;
exec($command, $output, $result);

cheers

Written by admin

March 14th, 2010 at 10:24 pm