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