ignore_user_abort(1) 且set_time_limit(0)然后设置了无限循环,怎么终止呢

WBOY
Release: 2016-06-13 12:39:10
Original
1242 people have browsed it

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

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!