note 85080 deleted from function.exec by nicos
| From: | nicos@php.net | Date: | Thu, 14 Aug 2008 00:35:31 +0000 |
| Subject: | note 85080 deleted from function.exec by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-143465@lists.php.net to get a copy of this message | ||
Note Submitter: Youssef Omar
Reason: bad code
----
The above note that says:
Note: If a program is started with this function, in order for it to continue running in the
background, the output of the program must be redirected to a file or another output stream. Failing
to do so will cause PHP to hang until the execution of the program ends.
This Note is missing an important part of it, if you do the redirect only as
<?php
exec("/php/bin/php file.php >/dev/null");
?>
php still hangs till the execution of that file is done.
to make it work as a background process, you need to add &
<?php
exec("/php/bin/php file.php >/dev/null &");
?>