I would like to execute a statement on my website, the server environment is LNMP, the single always return 127, can not be executed.
$dir = 'php /alidata/www/index.php gitblog exportsite';
exec("$dir",$output,$is_success);
print_r($output);
echo"<br>";
echo $is_success;
echo"<br>";
Error code 127
is returned for an illegal command. Try
$output=array(); // $output should be an array
$dir = '/alidata/www/index.php gitblog exportsite';
exec("$(which php) $dir",$output,$is_success);