脚本在返回标题之前超时:php.fastcgi

时间:2012-06-27 12:14:14

标签: php performance fastcgi

大约90秒后,我在apache错误日志中看到此错误。我在讨论我需要在PHP中增加一个设置,但我不确定要改变哪一个。

我可以增加一个设置来清除此错误吗?

2 个答案:

答案 0 :(得分:3)

在您的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 = 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

编辑值,重新启动apache,你就完成了。

答案 1 :(得分:2)

您可以在PHP脚本中调用set_time_limit(0);无限期限。