Re: Ping, Script ends before it's finished

From: Date: Mon, 13 Jan 2003 12:48:45 +0000
Subject: Re: Ping, Script ends before it's finished
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-17814@lists.php.net to get a copy of this message
Your first problem is likely to be the 30 sec runtime a script is allowed to take . See php.ini for this. Jochem Torben Dehn wrote:
Hello ! I am tryin to make a script that will ping a whole subnet and it looks like it works, but it does not... It will ping around 60 to 70 computers and then it will stop.. no error just finishes. I am new at php so maybe i am doing something wrong ? Any Help Would be appreciated. Another thing.. is there anyway to set a timelimit on the exec("ping -n 1 $realip", $result); command ? because if it pings an ip where there is no computer i will wait for several seconds before it will ping the next ip. The script looks like this <?php set_time_limit(0); for ($i=2;$i<=255;$i++) { $realip = "192.168.1.$i"; exec("ping -n 1 $realip", $result); echo $i." ".$result[3]."<hr>"; $result = ''; } ?>


« previous php.windows (#17814) next »