Re: Asynchronous PHP Execution
| From: | Shawn McKenzie | Date: | Sat, 05 Jul 2008 16:48:49 +0000 |
| Subject: | Re: Asynchronous PHP Execution | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276310@lists.php.net to get a copy of this message | ||
Richard Heyes wrote:
and exec/shell (but thatAlso: exec('sleep 5 >& /dev/null &'); Maybe? -Shawndoesn't seem to be asynchronous), but neither seems optimal.It can be if you redirect the output streams and put an ampersand after it: <?phpexec('sleep 5 > /dev/null 2>/dev/null &'); echo 'Script ended';?> This tiny sample should end immediately, and the sleep command should run on regardless.