脚本在返回标头之前超时:php.fastcgi
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11225932/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Script timed out before returning headers: php.fastcgi
提问by user1216398
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.
大约 90 秒后,我在我的 apache 错误日志中看到了这个错误。我假设我需要在 PHP 中增加一个设置,但我不确定要更改哪一个。
Is there one setting I can increase to clear this error?
是否可以增加一项设置来清除此错误?
采纳答案by Bud Damyanov
Find in your php.inifile something like this:
在您的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
Edit the values, restart apache and you are done.
编辑值,重新启动 apache 就完成了。
回答by Lusitanian
You can call set_time_limit(0);for an infinite time limit in your PHP script.
您可以set_time_limit(0);在 PHP 脚本中调用无限时间限制。

