php 如何修复 Plesk 中的 FastCGI 超时问题?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13905004/
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
How to fix FastCGI timeout issues in Plesk?
提问by Gary
PHP support is currently set to: run as Fast CGI.
PHP 支持当前设置为:作为 Fast CGI 运行。
I keep getting these errors in my server log:
我的服务器日志中不断出现这些错误:
mod_fcgid: read data timeout in 45 seconds
Premature end of script headers: index.php
mod_fcgid:45 秒内读取数据超时
脚本头过早结束:index.php
Should be quick fix I think, but I cant find the file to edit. Is this something I can change from Plesk.
我认为应该是快速修复,但我找不到要编辑的文件。这是我可以从 Plesk 更改的内容吗?
Anyone know how to increase the timeout?
有人知道如何增加超时吗?
回答by kenorb
In Plesk 12.x and similar go to Web Server Settingsand set the following directives:
在 Plesk 12.x 和类似版本中,转到Web 服务器设置并设置以下指令:
Additional directives for HTTP & HTTPS
HTTP 和 HTTPS 的附加指令
FcgidBusyTimeout 300
FcgidIOTimeout 250
Above lines will change the timeout for scripts that are quiet too long and take too long to execute.
以上几行将更改安静时间过长且执行时间过长的脚本的超时时间。
Additional nginx directives
其他 nginx 指令
proxy_read_timeout 300;
Above lines will change the proxy timeout.
以上几行将更改代理超时。
If the problem persist, increase the values.
如果问题仍然存在,请增加值。
See also: Premature end of script headers: index.php, mod_fcgid: read data timeout
另请参阅:脚本标题过早结束:index.php、mod_fcgid:读取数据超时
Check the screenshots for the guidance:
检查屏幕截图以获得指导:
回答by Rubendob
A solution provided in the forum of Plesk by Parallels staff
Parallels 工作人员在 Plesk 论坛中提供的解决方案
Edit the file:
/etc/httpd/conf.d/fcgid.conf
Specifically, change
FcgidIOTimeout 45
to
FcgidIOTimeout 3600
3600 seconds = 1 hour. Should be long enough for most but adjust upwards if required. I saw one example quoting 7200 seconds in there.
Finally, restart Apache to make the new setting active.
apachectl graceful
编辑文件:
/etc/httpd/conf.d/fcgid.conf
具体来说,改变
FcgidIO超时45
到
FcgidIO超时3600
3600 秒 = 1 小时。对于大多数人来说应该足够长,但如果需要可以向上调整。我在那里看到一个引用 7200 秒的例子。
最后,重新启动 Apache 以激活新设置。
优雅的apachectl
Hope it helps
希望能帮助到你
R
电阻
回答by Sam
My solution to this was to change the PHP settings in the plesk control pannel as per the screenshot.PHP Settings
我对此的解决方案是根据屏幕截图更改 plesk 控制面板中的 PHP 设置。PHP 设置
回答by Anon Joe
In the new version of Plesk the fcgid.conf file has moved to:
在新版本的 Plesk 中,fcgid.conf 文件已移至:
/etc/apache2/mods-available/fcgid.conf
/etc/apache2/mods-available/fcgid.conf
I had some issues importing an xml file into wordpress. It kept on giving a 500 Internal Error. The error log showed:
我在将 xml 文件导入 wordpress 时遇到了一些问题。它不断给出 500 内部错误。错误日志显示:
[Wed Jul 26 13:18:00.219226 2017] [fcgid:warn] [pid 4751] [client 145.97.205.8:60155] mod_fcgid: read data timeout in 45 seconds
[Wed Jul 26 13:18:00.219505 2017] [fcgid:warn] [pid 4751] (110)Connection timed out: [client 145.97.205.8:60155] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Wed Jul 26 13:18:00.219226 2017] [fcgid:warn] [pid 4751] [client 145.97.205.8:60155] mod_fcgid:45 秒内读取数据超时
[Wed Jul 26 13:18:00.219505 2017] [fcgid:warn] [pid 4751] (110)Connection timed out: [client 145.97.205.8:60155] mod_fcgid: ap_pass_request_ipc 函数handle_request_ipc 失败
After following some advice - as the PHP.INI settings made no difference - i changed some settings as advised:
在遵循一些建议之后 - 因为 PHP.INI 设置没有区别 - 我按照建议更改了一些设置:
Original:
原来的:
FcgidIOTimeout 45
To:
到:
FcgidIOTimeout 3600
Also added:
还补充道:
<IfModule mod_fcgid.c>
FcgidMaxRequestsPerProcess 500
<IfModule !mod_fastcgi.c>
Worked like a charm. Thank you for your help.
像魅力一样工作。感谢您的帮助。
回答by Shomon Robie
After changing max_execution_time = 3600 in /etc/php.ini solved my problem.
在 /etc/php.ini 中更改 max_execution_time = 3600 解决了我的问题。


