Pinging an IP without using exec or system

From: Date: Thu, 08 Apr 2004 17:18:09 +0000
Subject: Pinging an IP without using exec or system
Groups: php.general 
Request: Send a blank email to php-general+get-182877@lists.php.net to get a copy of this message
I am running scripts on a host that does not allow arbatrary commands to run via exec() or system(). However, I need to be able to test and see if an IP is active, basically ping it. I have only been able to find example scripts that use exec ot system to do the ping. Is there a way I can do a ping with something like fsockopen? I tried doing "@fsockopen($ip, 7, &$errno, &$errstr, 10);" which connects to the echo port for TCP, however it fails on many IPs I can ping successfully. Any suggestions?

« previous php.general (#182877) next »