note 80582 added to function.exec
| From: | dr_jones153 at hotmail dot com | Date: | Wed, 23 Jan 2008 15:04:48 +0000 |
| Subject: | note 80582 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135336@lists.php.net to get a copy of this message | ||
If SAFE_MODE is on, and you are trying to run a script in the background by appending ">
/dev/null 2> /dev/null & echo $!" to the command line, the browser will hang until the
script is done.
My solution:
Create a shell script (ex. runscript.sh) which contains the execution line for the script you are
trying to run in the background.
The runscript.sh is run by an exec() call without the redirect string, which is now placed in the
runscript.sh.
runscript.sh will return almost immediately because output of the original script is redirected, and
so will not hang your browser and the script runs fine in the background.
----
Server IP: 83.137.20.135
Probable Submitter: 156.83.1.5
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- https://master.php.net/note/edit/80582
Del: integrated -- https://master.php.net/note/delete/80582/integrated
Del: useless -- https://master.php.net/note/delete/80582/useless
Del: bad code -- https://master.php.net/note/delete/80582/bad+code
Del: spam -- https://master.php.net/note/delete/80582/spam
Del: non-english -- https://master.php.net/note/delete/80582/non-english
Del: in docs -- https://master.php.net/note/delete/80582/in+docs
Del: other reasons-- https://master.php.net/note/delete/80582
Reject -- https://master.php.net/note/reject/80582
Search -- https://master.php.net/manage/user-notes.php