密集型 PHP 脚本失败并出现“指定的超时已过期”错误 / ap_content_length_filter

2023-11-23

运行 MySQL 密集型 PHP 脚本失败。 Apache 日志报告了这一点:

[Wed Jan 13 00:20:10 2010] [error] [client xxx.xx.xxx.xxxx] (70007)
The timeout specified has expired:
ap_content_length_filter: apr_bucket_read() failed,
referer: http://domain.com/script.php

尝试过推杆set_time_limit(0)在顶部。

也尝试过set_time_limit(0)

都没有修复超时。

我可以设置一些特定的超时限制吗http.conf(或其他地方)来防止这种情况发生?


我也撞到了一堵非常相似的墙阿帕奇2.4.6 and PHP 5.4.23 FPM/FastCGI.

Symptom:

无论我在 PHP 或 Apache 中设置什么,我的脚本都会在 30 秒内超时,并且我会在 Apache 错误日志中看到以下内容:

[timestamp] [proxy_fcgi:error] [pid...] (70007)The timeout specified has expired: [client ...] AH01075: Error dispatching request to :

我的虚拟主机:

TimeOut  300
KeepAliveTimeout 300

<IfModule reqtimeout_module>
  RequestReadTimeout header=120-240,minrate=500
  RequestReadTimeout body=120,minrate=500
</IfModule>

<IfModule mod_proxy.c>
  ProxyTimeout 300
</IfModule>

<IfModule mod_fcgid.c>
  FcgidConnectTimeout 300
</IfModule>

讨厌的 php 脚本:

ini_set( 'max_execution_time', '120' );
...
ini_restore( 'max_execution_time' );

修复:这是 Apache 中的硬编码值mod_proxy_fcgi

在这里查看错误报告

  • A patch可用(上面的链接)
  • 该修复似乎尚未计划全面发布(2014 年 3 月)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

密集型 PHP 脚本失败并出现“指定的超时已过期”错误 / ap_content_length_filter 的相关文章

随机推荐