set_time_limit不起作用


ini_set('max_execution_time',3);
while(true) {
echo date("H:i:s");
sleep(1);
}
echo "done";

愿意希望这个php脚本运行3秒,但当使用sleep,usleep,mysql_connect,exec等函数时候,set_time_limit,ini_set(‘max_excution_time’),这样的执行时间控制函数就无用了.如果程序写了一个死循环,很可能就会卡死在进程里面了。目前无解,只能个写脚本定时kill这些僵死的php进程.

相关说明:http://cn.php.net/manual/zh/function.set-time-limit.php

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>