使 Apache 在传递 HTTP 408 请求超时之前等待更长时间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1488425/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 18:12:11  来源:igfitidea点击:

Make Apache wait longer before delivering HTTP 408 request timeout

phpapacheconfigurationcgifastcgi

提问by Aaron

My configuration: Apache 2.2.4 PHP 5.2.4 (fastCGI) Windows XP pro

我的配置:Apache 2.2.4 PHP 5.2.4 (fastCGI) Windows XP pro

I have a script that takes more than a minute to run but after exactly 60 seconds (proven by Fiddler) the server always delivers a 408 timeout. My PHP max execution time is set to 120 seconds. After doing some reading I've tried putting a "Timeout 120" directive in my Apache config file though I'm not confident that directive relates to what I'm trying to do. No dice. Is there any way to make apache wait longer before returning the 408? (Yes, I've restarted the web server between making config changes). Many thanks for any guidance.

我有一个脚本需要超过一分钟才能运行,但在 60 秒后(由 Fiddler 证明),服务器总是提供 408 超时。我的 PHP 最大执行时间设置为 120 秒。在做了一些阅读之后,我尝试在我的 Apache 配置文件中放置一个“超时 120”指令,尽管我不确定该指令与我正在尝试做的事情有关。没有骰子。有没有办法让apache在返回408之前等待更长时间?(是的,我在进行配置更改之间重新启动了 Web 服务器)。非常感谢您的指导。

回答by Neel

Try setting the -appConnTimeout parameter in the FastCgiServer directive.

尝试在FastCgiServer 指令中设置 -appConnTimeout 参数。

回答by magicbullet

I am not sure which one of these lines solves the problem; probalby the execution time - but it solved my 408 problems (added to settings.php):

我不确定这些行中的哪一行解决了问题;可能是执行时间 - 但它解决了我的 408 问题(添加到 settings.php):

    $conf['drupal_http_request_fails'] = FALSE;

    ini_set('max_execution_time',       '600');
    ini_set('memory_limit',             '512M');
    ini_set('upload_max_filesize',      '128M');
    ini_set('post_max_size',            '128M');
    ini_set('query_cache_size',         '128M');