在https://stackoverflow.com/a/12686252/219116之前已经询问并回答了这个问题,但是那里的解决方案对我不起作用。
mod_fcgid 配置
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
FcgidIPCDir /var/run/mod_fcgid/
FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm
FcgidIdleTimeout 60
FcgidProcessLifeTime 120
FcgidMaxRequestsPerProcess 500
FcgidMaxProcesses 150
FcgidMaxProcessesPerClass 144
FcgidMinProcessesPerClass 0
FcgidConnectTimeout 30
FcgidIOTimeout 600
FcgidIdleScanInterval 10
FcgidMaxRequestLen 269484032
</IfModule>
php-cgi 脚本
#!/bin/bassh
export PHPRC=/var/www/vhosts/example.com/etc/
export PHP_FCGI_MAX_REQUESTS=5000
exec /usr/bin/php-cgi
系统详情
- CentOS Linux 版本 7.1.1503(核心)
- httpd-2.4.6-31.el7.centos.x86_64
- mod_fcgid-2.3.9-4.el7.x86_64
- php56u-cli-5.6.12-1.ius.centos7.x86_64
所以我的 FcgidMaxRequestsPerProcess 设置为 500,我的 PHP_FCGI_MAX_REQUESTS 设置为 10 倍,如前面的答案和 Apache 文档中所建议的那样。然而我仍然得到这些错误
[Thu Nov 19 18:16:48.197238 2015] [fcgid:warn] [pid 6468:tid 139726677858048]
(32)Broken pipe: [client X.X.X.X:41098] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function