note 57952 added to ref.exec
| From: | senorchamo at netzero dot net | Date: | Wed, 19 Oct 2005 23:34:48 +0000 |
| Subject: | note 57952 added to ref.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97265@lists.php.net to get a copy of this message | ||
I've been trying to get a process to run in the background while the rest of the script which
called the process continues to run. The easiest way I found to do this in Linux is by executing
the following:
The script to run in the background is called $ProgExec
<?php
...script before...
exec("$ProgExec > /dev/null &");
...script after
?>
The "> /dev/null" makes all output go into a blackhole.
The "&" makes the process run in the background.
Works like a charm for me. Thought I'd spread the good news. :)
----
Manual Page -- http://www.php.net/manual/en/ref.exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57952
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57952&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57952&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57952&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57952&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57952&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57952&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57952&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57952&report=yes
Search -- http://master.php.net/manage/user-notes.php