欢迎访问 夜阑小雨 我的学习碎片档案,这里记录了我的学习内容和工作中经验,希望给您带去帮助。

【转】Fatal error: Maximum execution time of 30 seconds exceeded in

系统研究 夜阑小雨 1250℃ 0评论

Fatal error: Maximum execution time of 30 seconds exceeded in C:Program FilesApache Software FoundationApache2.2htdocscodecurlworkwork3.php on line 38

一看就是超时。懒人比较喜欢第二种解决方法。

看http://cn.php.net/manual/zh/info.configuration.php#ini.max-execution-time

就知道你的代码有多poor了。。。然后改了php.ini的话也不保证不出现类似错误,因为你的服务器也有超时,都设置为300如何?我在想。。。。重启apache,再试试。

max_execution_timeinteger

This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30. When running PHP from the command line the default setting is 0.

The maximum execution time is not affected by system calls, stream operations etc. Please see the set_time_limit() function for more details.

You can not change this setting with ini_set() when running in 安全模式. The only workaround is to turn off safe mode or by changing the time limit in the php.ini.

Your web server can have other timeout configurations that may also interrupt PHP execution. Apache has a Timeout directive and IIS has a CGI timeout function. Both default to 300 seconds. See your web server documentation for specific details.

–方法一————————————————————
Fatal error: Maximum execution time of 30 seconds exceeded in

有时在运行大型网站或百万级的数据时优化得不好会出来如Fatal error: Maximum execution time of 30 seconds exceeded in错误提供了了。那么这是什么原因了呢,从英语意思我们看得出是超过的脚本的最大限制的运行时间了,php 系统默认是30秒哦,如果超过就会出现如下提示错误哦。
下面我们来看看如何解决运行时间过长的方法吧。
在php自带了一个set_time_limit($secon)函数
$cecon是一个以秒为单位的的int型数值

set_time_limit(30);

//意思就是过了30秒如何本程序执行完,就会出来错误提供了。如果想让页面永远不过期的话就设置参数为0就行了。
set_time_limit(0);

–方法二————————————————————
Fatal error: Maximum execution time of 30 seconds exceeded
出现这个错误如何解决 去哪里可以设置最大执行时间

解决办法:
修改php.ini,
把max_execution_time = 30(默认值)的值进行修改,这里的单位是秒 ,你可以根据自己的需要更改其数值,然后重起服务
或者在程序写。
set_time_limit(时间) //0为无限制

转载请注明:夜阑小雨 » 【转】Fatal error: Maximum execution time of 30 seconds exceeded in

喜欢 (0)or分享 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址