PHP超时-set_time_limit(0); -不要工作 [英] php timeout - set_time_limit(0); - don't work
本文介绍了PHP超时-set_time_limit(0); -不要工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的PHP文件出现问题,执行该过程需要30秒钟以上.
I'm having a problem with my PHP file that takes more than 30 seconds to execute.
搜索后,我在代码的开头添加了set_time_limit(0);
,但是文件在30秒后仍显示为500 error
.
After searching, I added set_time_limit(0);
at the start of the code,cbut the file still times out with a 500 error
after 30 seconds.
log: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /xxx/xx/xxx.php
safe-mode : off
推荐答案
检查php.ini
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
ini_set('max_execution_time', 0); //0=NOLIMIT
这篇关于PHP超时-set_time_limit(0); -不要工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文