2014-01-11 54 views
1

我一直运行到下面的PHP错误运行我的脚本时PHP致命错误:最大的执行时间超过 - 的set_time_limit后EVEN(0)

致命错误:用C超过最长30秒的执行时间:\ WAMP \ APPS \ sqlbuddy1.3.3 \ functions.php的第22行

我已经把这个在我的PHP文件,我STILL收到此错误信息。

@set_time_limit(0); 

我错过了什么吗?

Edit:此错误仅在几分钟后才显示,而不是在30秒后显示。还有什么能延缓它的外观?

enter image description here

+2

永不** ** EVER **在调试时使用'@',特别是当事情明显不起作用时。你做的相当于把你的手指塞进耳朵里,然后“拉拉拉拉听不到你”。 –

+0

我不确定你的意思?我应该删除“@”吗?这只是为了调试吗? –

+1

'@'是错误抑制运算符。如果set_time_limit被禁用,您会收到警告。但是你用'@'压制了这个警告,所以是......“lalalala听不到你说我没有工作,因为我不想听” –

回答

0

set_time_limit()PHP行为的safe_mode运行时,没有任何效果。


既然你使用的是Windows,后来遇到超时超过30岁,你可能有别的地方在你的代码超时复位(set_time_limit(30))的事实:

The set_time_limit() function [..] only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.

搜索您的代码:

  • ini_set('max_execution_time', 30)
  • set_time_limit(30)
+0

您应该在单独的问题中提问(如果尚未解答)。 –

0

而不是依靠PHP文件来改变php.ini中设置,你应该自己做。寻找到php.ini文件保存WAMP,并更改/加入这一行:

max_execution_time = 500; 
+0

我已经在php.ini中修改了它(max_execution_time = 10000) –

0

有一个PHP配置是unallows脚本改变time_limit

This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.

你可以用phpinfo()检查safe_modemax_execution_time值:

您可以更改php.ini文件

相关问题