[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秒最长执行时间: ...
随机推荐
- CYQ.Data V5 MDataTable 专属篇介绍
前言 以前一两个月才出一篇,这三天有点变态地连续1天1篇(其实都是上周末两天写好的存货). 短期应该没有新的和此框架相关的文章要写了,这应该是最后一篇,大伙且看且珍惜. 前两篇讲数据库读写分离和分布式 ...
- 分分钟用上C#中的委托和事件
每一个初学C#的程序猿,在刚刚碰到委托和事件的概念时,估计都是望而却步,茫然摸不到头脑的.百度一搜,关于概念介绍的文章大把大把的,当然也不乏深入浅出的好文章.可看完这些文章,大多数新手,估计也只是信心 ...
- 通过Javascript得到URL中的参数(query string)
我们知道,"GET"请求中,通常把参数放在URL后面,比如这样http://www.cnblogs.com/season-huang/index?param=yes&art ...
- RBAC模型速记
RBAC Model core concept: user,role,permission,operation,resource user has many roles, assign role to ...
- Nova PhoneGap框架 第四章 本地数据库
我一直想把EntityFramework(简称EF)的那一套搬过来,应用于HTML5 SQLite. 幸运的是,我几乎做到了,有些功能无法完成的那是因为SQLite本身不支持.至少从现在已经完成的功能 ...
- HTML和CSS经典布局6
如下图: 需求: 1. 如图 2. 可以从任意div标签开始. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xh ...
- Google分布式构建软件之三:分布式执行构建步骤
注:本文英文原文在google开发者工具组的博客上[需要FQ],以下是我的翻译,欢迎转载,但请尊重作者版权,注名原文地址. 之前两篇文章分别介绍了Google 分布式软件构建系统Blaze相关的为了提 ...
- python 栈和队列(使用list实现)
5.1.1. Using Lists as Stacks The list methods make it very easy to use a list as a stack, where the ...
- Underscore.js使用
Underscore 是一个 JavaScript 工具库,它提供了一整套函数式编程的实用功能,但是没有扩展任何 JavaScript 内置对象. 他解决了这个问题:"如果我面对一个空白的 ...
- 【深入浅出Linux网络编程】 "开篇 -- 知其然,知其所以然"
[深入浅出Linux网络编程]是一个连载博客,内容源于本人的工作经验,旨在给读者提供靠谱高效的学习途径,不必在零散的互联网资源中浪费精力,快速的掌握Linux网络编程. 连载包含4篇,会陆续编写发出, ...