简体   繁体   English

如何修复 Plesk 中的 FastCGI 超时问题?

[英]How to fix FastCGI timeout issues in Plesk?

PHP support is currently set to: run as Fast CGI. PHP 支持当前设置为:作为快速 CGI 运行。

I keep getting these errors in my server log:我的服务器日志中不断出现这些错误:

mod_fcgid: read data timeout in 45 seconds mod_fcgid: 45 秒后读取数据超时

Premature end of script headers: index.php脚本头过早结束: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?任何人都知道如何增加超时?

In Plesk 12.x and similar go to Web Server Settings and 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:查看屏幕截图以获取指导:

Plesk 12.x - Web 服务器设置 - 其他 Apache 指令:HTTP 和 HTTPS 的其他指令 - FcgidBusyTimeout 和 FcgidIOTimeout

Plesk 12.x - Web 服务器设置 - 其他 nginx 指令 - proxy_read_timeout

A solution provided in the forum of Plesk by Parallels staff Parallels 工作人员在 Plesk 论坛中提供的解决方案

Edit the file:编辑文件:

/etc/httpd/conf.d/fcgid.conf /etc/httpd/conf.d/fcgid.conf

Specifically, change具体来说,改变

FcgidIOTimeout 45 FcgidIOTimeout 45

to

FcgidIOTimeout 3600 FcgidIO 超时 3600

3600 seconds = 1 hour. 3600 秒 = 1 小时。 Should be long enough for most but adjust upwards if required.对于大多数人来说应该足够长,但如果需要可以向上调整。 I saw one example quoting 7200 seconds in there.我在那里看到一个引用 7200 秒的例子。

Finally, restart Apache to make the new setting active.最后,重新启动 Apache 以使新设置生效。

apachectl graceful优雅的apachectl

Hope it helps希望能帮助到你

R R

My solution to this was to change the PHP settings in the plesk control pannel as per the screenshot.我对此的解决方案是根据屏幕截图更改 plesk 控制面板中的 PHP 设置。 PHP Settings PHP 设置

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.我在将 xml 文件导入 wordpress 时遇到了一些问题。 It kept on giving a 500 Internal Error.它不断给出 500 内部错误。 The error log showed:错误日志显示:

[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.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_brigade failed in handle_request_ipc function [Wed Jul 26 13:18:00.219505 2017] [fcgid:warn] [pid 4751] (110)连接超时:[client 145.97.205.8:60155] mod_fcgid: ap_pass_brigade 在 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.谢谢您的帮助。

After changing max_execution_time = 3600 in /etc/php.ini solved my problem.在 /etc/php.ini 中更改 max_execution_time = 3600 后解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM