ignore_user_abort(1) 且set_time_limit(0)然后设置了无限循环,如何终止呢?
本帖最后由 zhoumengkang 于 2013-08-09 17:24:21 编辑
今天看手册上的ingore_user_abort()里面有这样的例子,的确可以无限执行下去。但是如果终止这个进程呢?呵呵,,手册上的例子中没有说。
不重启服务器的情况下。怎么找到那个进程,然后终止?
ignore_user_abort(0); // run script in background <br />
set_time_limit(0); // run script forever <br />
$interval=2; // do every 15 minutes... <br />
do{ <br />
$data = '1<br/>';<br />
file_put_contents('./test.html',$data,FILE_APPEND);<br />
sleep($interval); // wait 15 minutes <br />
}while(true);
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31