Heim  >  Artikel  >  Backend-Entwicklung  >  Maximum execution time of 30 seconds exceeded_PHP教程

Maximum execution time of 30 seconds exceeded_PHP教程

WBOY
WBOYOriginal
2016-07-13 17:49:29777Durchsuche

Maximum execution time of 30 seconds exceeded 错误解决方案.

简单总结一下解决办法:

报错一:内存超限,具体报错语句忘了,简单说一下解决办法。

利用循环分批导入;
每个循环内部开始处使用sleep(5);语句,做延迟执行,防止服务器内存同一时间占用过多,里面数字据情况修改;
每个循环内部结束地方使用 ob_flush();刷新输出缓冲
flush();将当前为止程序的所有输出发送到用户的浏览器
两者必须同时使用来刷新输出缓冲www.2cto.com

报错二:30秒运行超时的错误(Maximum execution time of 30 seconds exceeded)

解决办法:

方法一,修改php.ini文件

max_execution_time = 30; Maximum execution time of each script, in seconds
把它设置成需要的值就可以了。如果设置成0的话,就是永不过期。
方法二,修改php执行文件
加上

set_time_limit(0);
?>

max_execution_time = 30; Maximum execution time of each script, in seconds
把它设置成需要的值就可以了。如果设置成0的话,就是永不过期。
 

摘自 顺子网络 PHP网站建设

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478350.htmlTechArticleMaximum execution time of 30 seconds exceeded 错误解决方案. 简单总结一下解决办法: 报错一:内存超限,具体报错语句忘了,简单说一下解决办法。...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn