How to fire off a unix command WITHOUT waiting for it to return (I want to use &)
| From: | Daevid Vincent | Date: | Fri, 10 Oct 2003 23:07:54 +0000 |
| Subject: | How to fire off a unix command WITHOUT waiting for it to return (I want to use &) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-165810@lists.php.net to get a copy of this message | ||
How can I cause PHP to fire off a unix program and NOT wait for a reply.
Basically I want to use the "&" love the unix provides, but it seems that
exec, passthrough, system and even
all wait for a return despite my
putting something like exec("/bin/scan &"); or /bin/scan &
*sigh*
The sitch is that I'm scanning/pinging/nmap a HUGE amount of IP addresses.
Perhaps 254 - 65000 or more individual iP addresses. We have a multithreaded
scanner that we wrote in C that can to this quickly, but it's still a wait.
It pulls from a db the ips to scan and sets their up/down flags. My php
scheduler page queries to get the ones that are up.
So as you see, I don't want to wait for a return code, I know the status via
the db and how many rows are done/need to be done.
Daevid Vincent.
http://daevid.com