[PHP]Maximum execution time of 30 seconds exceeded
前言
在使用PHP渲染页面页面的时候,如果程序处理的时间特别久,超过配置文件(php.ini)设置的超时时间,就会出现如下提示:
Maximum execution time of 30 seconds exceeded
例如:导入大量数据到数据库中;请求资源时间过长……
问题
PHP程序超时发生错误提示怎么办?
方法
- 直接修改配置文件(php.ini)[超时]
#默认的最大执行时间是30s,可根据自己的需求做修改
#如果是0,即永不过期
max_execution_time = 30;
- 间接修改配置信息[超时]
在php执行文件中加入如下代码:
set_time_limit(0);
- 刷新输出缓冲[内存超限]
- 在循环当中做延迟执行:加入函数
sleep(time) - 输出缓冲:同时使用
ob_flush()和flush()函数将数据发送到浏览器
- 在循环当中做延迟执行:加入函数
<?php
for ($i=0; $i < 10000; $i++) {
echo "hello ".printf('%05s',$i).'<br/>';
ob_flush();
flush();
}
[PHP]Maximum execution time of 30 seconds exceeded的更多相关文章
- Drupal错误:drupal Maximum execution time of 30 seconds exceeded database in解决方法
Drupal开源内容管理框架 Drupal是使用PHP语言编写的开源内容管理框架(CMF),它由内容管理系统(CMS)和PHP开发框架(Framework)共同构成.连续多年荣获全球最佳CMS大奖,是 ...
- Maximum execution time of 30 seconds exceeded解决错误方法
Maximum execution time of 30 seconds exceeded解决错误方法Fatal error: Maximum execution time of 30 seconds ...
- PHP超过三十秒怎么办Maximum execution time of 30 seconds exceeded
1 如图所示, Maximum execution time of 30 seconds exceeded 2 在php.ini文件中查找"max_execution_time"把 ...
- Maximum execution time of 30 seconds exceeded解决办法
Maximum execution time of 30 seconds exceeded,今天把这个错误的解决方案总结一下: 简单总结一下解决办法: 报错一:内存超限,具体报错语句忘了,简单说一下解 ...
- Fatal error: Maximum execution time of 30 seconds exceeded in
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Software Found ...
- 【PHP】Maximum execution time of 30 seconds exceeded解决办法
Maximum execution time of 30 seconds exceeded,今天把这个错误的解决方案总结一下: 简单总结一下解决办法: 报错一:内存超限,具体报错语句忘了,简单说一下解 ...
- 解决php网页运行超时问题:Maximum execution time of 30 seconds exceeded
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Inetpub\wwwroot\ry.php on line 11 意 ...
- Mysql : Maximum execution time of 30 seconds exceeded
在向Mysql数据库中插入数据时,提示Maximum execution time of 30 seconds exceeded.......翻译:最大运行时间超过30秒. 最后在php.ini中找到 ...
- Maximum execution time of 30 seconds exceeded in
在执行一次php脚本的时候,遇到了这样的报错,经过c Maximum execution time of 30 seconds exceeded in 翻译过来就是:执行时间超过了30秒最长执行时间: ...
随机推荐
- CSS 基础语法
注:CSS对大小写不敏感,但是如果涉及到与HTML文档一起工作的时候,class和id名称对大小写是敏感的 一.color color:#ff0000; color:#f00; //缩写 color: ...
- .NET开源OpenID和OAuth解决方案Thinktecture IdentityServer
现代的应用程序看起来像这样: 典型的交互操作包括: 浏览器与 web 应用程序进行通信 Web 应用程序与 web Api (有时是在他们自己的有时代表用户) 通信 基于浏览器的应用程序与 web A ...
- .NET面试题系列[14] - LINQ to SQL与IQueryable
.NET面试题系列目录 名言警句 "理解IQueryable的最简单方式就是,把它看作一个查询,在执行的时候,将会生成结果序列." - Jon Skeet LINQ to Obje ...
- [译]Asp.net MVC 之 Contorllers(一)
Asp.net MVC contorllers 在Ajax全面开花的时代,ASP.NET Web Forms 开始慢慢变得落后.有人说,Ajax已经给了Asp.net致命一击.Ajax使越来越多的控制 ...
- [ASP.NET MVC 小牛之路]01 - 理解MVC模式
本人博客已转移至:http://www.exblr.com/liam PS:MVC出来很久了,工作上一直没机会用.出于兴趣,工作之余我将展开对MVC的深入学习,通过博文来记录所学所得,并希望能得到各 ...
- [公告]Senparc.Weixin.MP v14.2.1 升级说明
在Senparc.Weixin.MP v14.2.1中,所有Senparc.Weixin.MP下的Container,命名空间已经从 Senparc.Weixin.MP.CommonAPIs 改为了 ...
- 加谁的QQ,并聊天‘
tencent://AddContact/?fromId=45&fromSubId=1&subcmd=all&uin=150540451&fuin=904776475
- DLL导出函数和类的定义区别 __declspec(dllexport)
DLL导出函数和类的定义区别 __declspec(dllexport) 是有区别的, 请看 : //定义头文件的使用方,是导出还是导入 #if defined(_DLL_API) #ifndef D ...
- 深入理解客户区尺寸client
前面的话 关于元素尺寸,一般地,有偏移大小offset.客户区大小client和滚动大小scroll.前文已经介绍过偏移属性,后文将介绍scroll滚动大小,本文主要介绍客户区大小client 客户区 ...
- Android探索之HttpURLConnection网络请求
前言: 最近一直想着学习一下比较好的开源网络框架okhttp,想着学习之前还是先总结一下Android原生提供的网络请求.之前一直在使用HttpClient,但是android 6.0(api 23) ...