PHP守护进程常用方法
ignore_user_abort — 设置客户端断开连接时是否中断脚本的执行
set_time_limit — 设置脚本最大执行时间<?php
ignore_user_abort(true);
set_time_limit(0);
while(1)
{
// Did the connection fail?
if(connection_status() != CONNECTION_NORMAL)
{
break;
}
// Sleep for 10 seconds
sleep(10);
}
转载
http://php.net/manual/zh/function.ignore-user-abort.php
http://php.net/manual/zh/function.set-time-limit.php
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。