| Newsgroups |
php.notes |
| Message-ID |
<[email protected]> |
When calling exec() from within an apache php script, make sure to take care of stdout, stderr and stdin (as in the example below). If you forget this and your shell command produces output the sh and apache deamons may never return (they will normally time out after a few minutes). From the calling web page the script may seem to not return any data.
If you want to start a php process that continues to run independently from apache (with a different parent pid) use nohub. Example:
exec('nohup php process.php > process.out 2> process.err < /dev/null &');
----
Server IP: 69.147.83.197
Probable Submitter: 83.84.88.174
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- https://master.php.net/note/edit/102342
Del: integrated -- https://master.php.net/note/delete/102342/integrated
Del: useless -- https://master.php.net/note/delete/102342/useless
Del: bad code -- https://master.php.net/note/delete/102342/bad+code
Del: spam -- https://master.php.net/note/delete/102342/spam
Del: non-english -- https://master.php.net/note/delete/102342/non-english
Del: in docs -- https://master.php.net/note/delete/102342/in+docs
Del: other reasons-- https://master.php.net/note/delete/102342
Reject -- https://master.php.net/note/reject/102342
Search -- https://master.php.net/manage/user-notes.php