Hi all...
I am trying to use the exec command to ping a server on the local network through PHP. The problem I have is that the result of the ping is not being passed back to the PHP when the script is executed from a browser.
The command I am using is simply:
<?php echo exec('ping bbc.co.uk -c 1'); ?>
This does not return anything at all. It works FINE when I run the file from the command line (php -f test.php outputs the result of the ping). Also the apache user has not issues running the ping command (sudo -u apache ping -c 1 works fine). This is really annoying me.
It is not the exec command across the board, because an exec('whoami') return "apache". This is really annoying me, any advice or help will be greatly received!
G
-Geeeeeeeeeeeeeeeeeeeeeeee-
I am trying to use the exec command to ping a server on the local network through PHP. The problem I have is that the result of the ping is not being passed back to the PHP when the script is executed from a browser.
The command I am using is simply:
<?php echo exec('ping bbc.co.uk -c 1'); ?>
This does not return anything at all. It works FINE when I run the file from the command line (php -f test.php outputs the result of the ping). Also the apache user has not issues running the ping command (sudo -u apache ping -c 1 works fine). This is really annoying me.
It is not the exec command across the board, because an exec('whoami') return "apache". This is really annoying me, any advice or help will be greatly received!
G
-Geeeeeeeeeeeeeeeeeeeeeeee-