php-fpm
, nginx
exec when in use .phpfiles()
shell_exec()
system()
works fine from the command line.
Example when works well:
#php myphp.php
myphp.php
contains:
<?php
exec('ping -c 3 google.com', $output);
print_r($output);
?>
But if I put on my browser http://localhost/myphp.php
, it does not work anymore.
Any ideas? I edit
I made a file with the following contents:
#cat info.php
<?php
if(function_exists('exec')) {
echo "exec is enabled";
}
phpinfo();
?>
In my browser, print
exec is enabled, y php info..
I made a file with the following contents:
#cat info.php
<?php
// Check for safe mode
if( ini_get('safe_mode') ){
// Do it the safe mode way
echo "Do it the safe mode way";
}else{
// Do it the regular way
echo "Do it the regular way";
}
?>
In my browser, print
Do it the regular way
Did not I like to know if I'm in a jail?
In my php ini
#cat /etc/php-5.5.ini
safe_mode not shown, or ON or OFF. simply does not exist