Script timed out before returning headers: php.fastcgi

删除回忆录丶 提交于 2021-02-07 03:43:04

问题


After about 90 seconds I see this error in my apache error log. I'm assusming I need to increase a setting in PHP but I'm not sure which one to change.

Is there one setting I can increase to clear this error?


回答1:


Find in your php.ini file something like this:

; 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 = 600    

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts. 
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 600

Edit the values, restart apache and you are done.




回答2:


You can call set_time_limit(0); for an infinite time limit in your PHP script.



来源:https://stackoverflow.com/questions/11225932/script-timed-out-before-returning-headers-php-fastcgi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!