note 86329 added to function.exec
| From: | ArnovandenBrink at osu1 dot php dot net | Date: | Mon, 13 Oct 2008 15:04:41 +0000 |
| Subject: | note 86329 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145319@lists.php.net to get a copy of this message | ||
I combined several efforts in this topic into one function:
function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
}
This will execute $cmd in the background (no cmd window) without PHP waiting for it to finish, on
both Windows and Unix.
----
Server IP: 213.249.64.162
Probable Submitter: 83.160.168.41
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- https://master.php.net/note/edit/86329
Del: integrated -- https://master.php.net/note/delete/86329/integrated
Del: useless -- https://master.php.net/note/delete/86329/useless
Del: bad code -- https://master.php.net/note/delete/86329/bad+code
Del: spam -- https://master.php.net/note/delete/86329/spam
Del: non-english -- https://master.php.net/note/delete/86329/non-english
Del: in docs -- https://master.php.net/note/delete/86329/in+docs
Del: other reasons-- https://master.php.net/note/delete/86329
Reject -- https://master.php.net/note/reject/86329
Search -- https://master.php.net/manage/user-notes.php