2014-01-11 55 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文件

相關問題