I have this little peice of code that fails to run under PHP but runs fine a a user.
exec("/var/www/SNS/PLANETS/Programs/Planet_Positions.exe",$out,$return);
//echo output.
echo "exit code = " . $return;
echo "<br/>$ out =" . $out . "<br/>";
//show output
echo "$ out = ";
print_r($out);
echo "<br/>Array $ out output = <br/>";
foreach ($out as $val)
{
echo htmlentities($val) . "<br/>";
}
Here is the output
exit code = 6
$ out =Array
$ out = Array ( [0] => [1] => [2] => PLANETARY POSITION PROGRAM )
Array $ out output =
PLANETARY POSITION PROGRAM
note that array 2 is only the first line of output.
Is exec not allowed to execute programs below web root? ie /var/www/