Connection reset by peer: mod_fcgid: error reading

2019-01-11 06:03发布

I am having issue on PHP where my app is trying to run a php backup file and suddenly getting HTTP Error 500 Code. I have checked the logs and this what it saying.

[Tue Aug 28 14:17:28 2012] [warn] [client x.x.x.x] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://example.com/backup/backup.php
[Tue Aug 28 14:17:28 2012] [error] [client x.x.x.x] Premature end of script headers: backup.php, referer: http://example.com/backup/backup.php

Anyone knows how to fix this? I'm really stuck in here and can't find solution in internet.

Hope anyone could share their knowledge.

Thanks. James

15条回答
啃猪蹄的小仙女
2楼-- · 2019-01-11 06:09

I managed to solved this by adding FcgidBusyTimeout . Just in case if anyone have similar issue with me.

Here is my settings on my apache.conf:

<VirtualHost *:80>
.......
<IfModule mod_fcgid.c>
FcgidBusyTimeout 3600
</IfModule>
</VirtualHost>
查看更多
狗以群分
3楼-- · 2019-01-11 06:12

Just install php5-cgi in debian

sudo apt-get install php5-cgi

in Centos

sudo yum install php5-cgi
查看更多
手持菜刀,她持情操
4楼-- · 2019-01-11 06:13

Check /var/lib/php/session and its permissions. This dir should be writable by user so the session can be stored

查看更多
放我归山
5楼-- · 2019-01-11 06:15

I had the same problem with long-running scripts with the error messages "Premature end of script headers: index.php" and "Connection reset by peer: mod_fcgid: error reading data from FastCGI server" in error_log. After hours of testing this helps for me (CentOS 6, PHP-FPM 7, Plesk 12.5.30):

edit the config file:

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

Set a higher running time. In my case 600 seconds

create the new entry:

FcgidBusyTimeout 600

adapt following entries:

FcgidIOTimeout 600

FcgidConnectTimeout 600

restart httpd:

service httpd restart

查看更多
仙女界的扛把子
6楼-- · 2019-01-11 06:15

I increased max execution time to 600 seconds job done !

plesk 17 - domain effected

查看更多
倾城 Initia
7楼-- · 2019-01-11 06:17

I came across this one while debugging a virtualmin/apache related error.

In my case, I am running virtualmin and had in my virtual machine's php.ini safe_mode=On.

In my Virtual Machine's error log, I was getting the fcgi Connection reset by peer: mod_fcgid: error reading data from FastCGI server

In my main apache error log I was getting: PHP Fatal error: Directive 'safe_mode' is no longer available in PHP in Unknown on line 0

In my case, I simply set safe_mode = Off in my php.ini and restarted apache.

stackoverflow.com/questions/18683177/where-to-start-with-deprecated-directive-safe-mode-on-line-0-in-apache-error

查看更多
登录 后发表回答