PHP中超时提示Fatal error: Maximum ex...
来源:互联网 发布:js漂浮广告带关闭 编辑:程序博客网 时间:2024/06/10 00:46
由于近日做的程序中涉及到的循环比较多且处理的情况较复杂,所以在运行程序时出现执行超时提示如下:
Fatal error: Maximum execution time of 30 seconds exceeded in D:\php\AppServ\www\sum3\test.php on line 3
通过在网上搜索,找到以下解决方案给大家分享一下:
这个错误是说你的php
执行时间越过了配置文件中设置的最大执行时间30秒钟,这不是你的程序本身存在的问题,而
是系统的配置文件问题,如果你的网速快的话,可能再执行一次就不会出现这种错误了,不过
有了出现这种问题也可以进行一定的修改,方法有三种:
1.修改php的配置文件,找到php.ini文件,它一般应该放在你的C:\WINDOWS目录下,然后找到
max_execution_time = 30 ;//设置成你想要的值,单位是秒
这一行,这就是设置的执行时间最大值为30秒,你可以对这个值进行一下修正,改为你的期望值。(也可以直接设置成:max_execution_time = 0)
2.使用ini_set()函数,不是所有人都能修改php.ini文件的,那么你可以使用这个函数来改变你的最大执行时间限制值,如:
ini_set('max_execution_time', '100');
则设置为100秒,你也可以设置为0,那么就是不限制执行的时间。
3.使用set_time_limit()函数,set_time_limit(20)则表示最大执行时间加上20秒,但如果在php执行安全模式时,set_time_limit()将不会有结果,除非你用了第一种方法。
以下是部分讲解:set_time_limit --- 限制最大的执行时间set_time_limit(PH3 , PHP4)set_time_limit --- 限制最大的执行时间语法 : void set_time_limit (int seconds)说明 : 设定一个程式所允许执行的秒数,如果到达限制的时间,程式将会传回错误。
它预设的限制时间是30秒,max_execution_time的值定义在结构档案中(在PHP3中叫做php3.ini,在PHP4则叫做php.ini),如果将秒数设为0,表示无时间上的限制。
当呼叫此函式时,set_time_limit( )会从零重新开始计算最长执行的时间,也就是说,如果最长执行时间为预设的30秒,而在呼叫此函式set_time_limit(20)之前已花了25秒来执行程式,则程式最长执行的时间将会是45秒。
注意 : 当PHP是执行在安全模式时,set_time_limit( )将不会有结果,除非是关闭安全模式或是修改结构档案中(在PHP3中叫做php3.ini,在PHP4则叫做php.ini)的时间限制。
- PHP中超时提示Fatal error: Maximum ex...
- PHP中超时提示Fatal error: Maximum ex...
- PHP中超时提示Fatal error: Maximum execution time of 30 seconds exceeded的解决方案
- 【转载】PHP中超时提示Fatal error: Maximum execution time of 30 seconds exceeded的解决方案
- 处理PHP mysql_query执行超时 【Fatal error: Maximum execution time of 300 seconds exceeded in……】
- PHP中出现Fatal error: Cannot re-assign auto-global variable _POST的错误提示
- php中提示Fatal error: require(),“include_path=’.;c:\php5\pear’”错误的解决方法
- php中通过register_shutdown_function记录fatal error
- PHP连 Mysql 提示: Fatal error:undefined function mysql_connect()
- php提示错误信息: Fatal error: Call to undefined function openssl_pkcs12_read()
- php Fatal error: Maximum execution time of 30 seconds exceeded in 问题的解决方案
- Fatal error: Maximum execution time of 60 seconds exceeded in *.php on line...
- php报错fatal error maximum execution time of 30 seconds exceeded in
- php Fatal error: Maximum execution time of 30 seconds exceeded解决方案
- PHP提示Fatal error: Allowed memory size of 8388608 bytes exhausted的解决办法
- apache,php安装好之后提示Fatal error: Call to undefined function mb_detect_encoding()
- [乐意黎原创] php 页面提示 Fatal error: Call to undefined function curl_init()
- php 导入excel解析提示 Fatal error: Class 'ZipArchive' not found解决方法
- UVa 11152 - Colourful Flowers
- 解惑rJava R与Java的高速通道
- Linux时间戳和标准时间的互转
- 个人实践:ubuntu 12.04 3D 配置
- eclipse的html、jsp等编辑插件
- PHP中超时提示Fatal error: Maximum ex...
- JavaMail通过IMAP和POP3接收未读以及设置已读邮件
- MySQL 返回影响行数的测试示例
- 文字处理控件TX Text Control X10独家揭秘(一):数据源自动处理
- 利用pl/sql执行计划评估SQL语句的性能简析
- dex2jar工具进行反编译
- android让整个应用最小化(类是qq按back建的效果)
- ACM SIGCHI Curricula for Human-Computer Interaction
- configuring tomcat to support SSL