Re: How to fire off a unix command WITHOUT waiting for it to return (I want to use &)

From: Date: Sat, 11 Oct 2003 12:01:35 +0000
Subject: Re: How to fire off a unix command WITHOUT waiting for it to return (I want to use &)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-165844@lists.php.net to get a copy of this message
Try exec("/bin/scan & > /dev/null 2>/dev/null"); Daevid Vincent wrote:
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


« previous php.general (#165844) next »