PHP头条
热点:

[PHP]Maximum execution time of 30 seconds exceeded,executionexceeded


前言

在使用PHP渲染页面页面的时候,如果程序处理的时间特别久,超过配置文件(php.ini)设置的超时时间,就会出现如下提示:

Maximum execution time of 30 seconds exceeded

例如:导入大量数据到数据库中;请求资源时间过长……

问题

PHP程序超时发生错误提示怎么办?

方法

  • 直接修改配置文件(php.ini)[超时]
#默认的最大执行时间是30s,可根据自己的需求做修改
#如果是0,即永不过期
max_execution_time = 30;
  • 间接修改配置信息[超时]
    在php执行文件中加入如下代码:
set_time_limit(0);
  • 刷新输出缓冲[内存超限]
<?php

for ($i=0; $i < 10000; $i++) {
    echo "hello ".printf('%05s',$i).'<br/>';
    ob_flush();
    flush();
}


作者:seayxu
链接:https://www.jianshu.com/p/6d8a99621e8b
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

www.phpzy.comtrue/php/6368.htmlTechArticle[PHP]Maximum execution time of 30 seconds exceeded,executionexceeded 前言 在使用 PHP 渲染页面页面的时候,如果程序处理的时间特别久,超过配置文件(php.ini)设置的超时时间,就会出现如下提示:...

相关文章

    暂无相关文章
相关频道:

PHP之友评论

今天推荐