note 105569 added to function.set-time-limit
| From: | alexander dot krause at ed-solutions dot de | Date: | Mon, 29 Aug 2011 09:26:10 +0000 |
| Subject: | note 105569 added to function.set-time-limit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182793@lists.php.net to get a copy of this message | ||
A nice workaround to have a real max_execution_time (needs posix and pcntl):
$pid=pcntl_fork();
if ($pid) {
//long time process
$a=0;
while (true) {
echo "a=$a\n\n";
ob_flush();
flush();
$a++;
shell_exec('sleep 10&');
}
} else {
//time-limit checker
sleep(5);
posix_kill(posix_getppid(),SIGKILL);
}
----
Server IP: 69.147.83.197
Probable Submitter: 87.139.101.10
----
Manual Page -- http://www.php.net/manual/en/function.set-time-limit.php
Edit -- https://master.php.net/note/edit/105569
Del: integrated -- https://master.php.net/note/delete/105569/integrated
Del: useless -- https://master.php.net/note/delete/105569/useless
Del: bad code -- https://master.php.net/note/delete/105569/bad+code
Del: spam -- https://master.php.net/note/delete/105569/spam
Del: non-english -- https://master.php.net/note/delete/105569/non-english
Del: in docs -- https://master.php.net/note/delete/105569/in+docs
Del: other reasons-- https://master.php.net/note/delete/105569
Reject -- https://master.php.net/note/reject/105569
Search -- https://master.php.net/manage/user-notes.php