Re: Asynchronous PHP Execution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Heyes wrote:
 > and exec/shell (but that
doesn't seem to be asynchronous), but neither seems optimal.

It can be if you redirect the output streams and put an ampersand after it:

<?php
    exec('sleep 5 > /dev/null 2>/dev/null &');
    echo 'Script ended';
?>

This tiny sample should end immediately, and the sleep command should run on regardless.


Also:

exec('sleep 5 >& /dev/null &');

Maybe?
-Shawn


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux