php-fpm , nginx exec when using .phpfiles() shell_exec() system() works fine from the command line.
An example when it 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 no longer works.
Any ideas? I am editing
I made a file with the following contents:
#cat info.php <?php if(function_exists('exec')) { echo "exec is enabled"; } phpinfo(); ?>
In my browser, type
exec 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, type
Do it the usual way
Didn't I want to know if I ended up in jail?
In my php ini
safe_mode is not displayed, either ON or OFF. just doesn't exist
source share