2014-08-29 89 views
1

我使用xampp(php版本5.25)並使用https。我執行一些腳本,以使用REST API,這需要60秒以上來執行,但我一直收到此錯誤 「致命錯誤:超過60秒的最長執行時間」默認套接字超時[XAMPP HTTPS]

我曾試圖設置默認套接字超時我腳本但沒有成功。

ini_set("default_socket_timeout", 120); 

我也沒有註釋

LoadModule rewrite_module modules/mod_rewrite.so //http.conf apache file 

創造的.htaccess與

php_value default_socket_timeout 9000 

但儘管如此,錯誤消息說,60秒最長執行時間超出。 我也從phpinfo()中檢查了「default_socket_timeout」的主值和本地值,他們說它的值爲60. 任何解決方案?

回答

1

將它放在您的PHP腳本的頂部。

ini_set('max_execution_time', 300); //300 seconds = 5 minutes 

如果有,將採取比默認爲30秒鐘幾個PHP文件,你可能希望通過編輯這一行通過php.ini文件全局更改它:

; Maximum execution time of each script, in seconds 
; http://php.net/max-execution-time 
; Note: This directive is hardcoded to 0 for the CLI SAPI 
max_execution_time=30