I am on Redhat 9 and Safe Mode is off. I checked a ping program but it is not showing any result. I have tried so many commands to run the ping from PHP it does not show any result.
PHP Code:<?php
echo 'Ping : ';
// It is showing RESULTS
$last_line = system('ls -la');
// Not showing anything
//$last_line = system('ping -c 5 google.com', $retval);
// Not showing anything
//$last_line = passthru("ping -c 5 google.com", $retval);
//echo $last_line. " ". $retval;
// Not showing anything
//$a = shell_exec("ping -c 5 google.com");
// Not showing anything
$a = shell_exec('ping');
// It is created folder successfully
echo mkdir("/home/frmwhev4/www/abc/Folder");
echo "folder created";
?>
When I tried to run system('ls -la'); command it shows the result but when I place the command system('ping'); it does not show any result whereas it should show some output.
Note: I am able to run ping from SSH but not able to run from PHP. Below are the ping Permissions
-rwsr-xr-x 1 root bin 28628 Jan 24 2003 ping*
Can anyone know the problem !



LinkBack URL
About LinkBacks
Reply With Quote





