| View previous topic :: View next topic |
| Author |
Message |
squirrel
Joined: 29 Mar 2007 Posts: 1
|
Posted: Thu Mar 29, 2007 8:40 pm Post subject: Cannot Net_Ping::ping() from inside Apache |
|
|
I'm writing a web app that attempts to ping a system on the network to determine if the system is alive. When I run the following code from the console, things work great:
| Code: | <?php
require_once('Net/Ping.php');
$ping = Net_Ping::factory();
$address = '192.168.1.1';
$result = $ping->ping($address);
if ( PEAR::isError($result) ) {
echo "Host is not up (";
echo $result->getMessage;
echo ")\n";
} else {
echo "Host is up and replied (";
echo $result->getReceived();
echo ")\n";
}
?> |
Result:
| Quote: | | Host is up and replied (3) |
When I try to run the same code under Apache 2.2.3 on Fedora Core 6 (PHP version 5.1.6), the Net_Ping::ping() command always returns with an 'unknown host' error.
Any advice on how to fix this?
Thanks!
Chris |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|