mod_fcgid: error reading data from FastCGI server

imploder303

Registered
Sep 29, 2004
4
0
151
Hi,
I usually don't need to post questions, but this is driving me crazy:eek:. I'm running a Cpanel box with apache/mod_fcgid/php5/eaccelerator.
I switched to mod_fcgid from su_php and it runs extremely well, except for this minor glitch:
Code:
Wed Feb 02 12:44:38 2011] [error] [client xxx.xxx.xxx.xx] Premature end of script headers: index.php, referer: http://www.xxx.com/xxxx/
[Wed Feb 02 12:44:38 2011] [warn] [client xxx.xxx.xxx.xx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://www.xxx.com/xxxx/
This is a random error that throws a 500 page when it happens. I tried different configurations for fcgi with no positive results, but I found out one odd fact: this error occurs every exact 4 minutes, at 38 seconds, no matter how many times I restart apache, it shows up every time at xx:xx:38 201x.

I checked for mod_fcgid options with 240 seconds, custom or default, and I didn't find any. Of course, this is a high-traffic server, so errors appear often related to the site that's taking this traffic.

I'll appreciate any clues, hints or solutions!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Do you have APC and/or Zend Optimizer active on the machine?

I realize that EAccelerator is being used and I've found similar errors such as "Connection reset by peer: mod_fcgid: error reading data from FastCGI server" in researching systems with Zend + APC running together. It's possible that Zend Optimizer, EAccelerator and/or APC (if this is being used) are contributing to the issue.

You might try disabling any or all of these by commenting them out of the global php.ini file at /usr/local/lib/php.ini and restarting Apache to see the results.
 

imploder303

Registered
Sep 29, 2004
4
0
151
Hi Tristan, thanks for your answer.
Unfortunately, the error persisted disabling eaccelerator or zend optimizer and both at the same time. APC is not installed at all. Any clues? Thank you!
 

xanubi

Well-Known Member
Jun 28, 2006
86
2
158
I've one sugestion. If you have the configserver firewall, see the parameter PT_USERMEM and put it to ZERO. That parameter on fastcgi can kill php processes, causing that problem.

If you don't have this, try to disable IONCUBE and Frontpage.
 

imploder303

Registered
Sep 29, 2004
4
0
151
I've one sugestion. If you have the configserver firewall, see the parameter PT_USERMEM and put it to ZERO. That parameter on fastcgi can kill php processes, causing that problem.

If you don't have this, try to disable IONCUBE and Frontpage.
Hi Xanubi, thanks for the tip. Unfortunately it didn't make it. I even disabled completely the firewall with no luck. Nevertheless is worth noting that might impact so I left the setting as you suggested, thank you.

What really bugs me is that the error shows up every exactly four minutes, at second 38, like it was a cron or something. I've checked every possible clue, including apache support lists, and recompiled with Apache php 5.2.16 with no luck so far. Mod_fcgid still is 2.3.5 even though version 2.3.6 is out, is it possible to update this module within cpanel?

Thanks for your help.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

Would you be able to open a ticket using the link in my signature or in WHM > Support Center > Contact cPanel area? This way we can see if we can determine why this might be happening.

If you do open a ticket, please post the ticket number here.

Thanks.
 

cehis

Registered
May 24, 2011
2
0
51
Hello.
I have this problem.

How i Can fix it.

[Mon Jun 13 10:54:39 2011] [warn] [client xxx.xxx.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Mon Jun 13 10:54:39 2011] [error] [client xxx.xxx.xxx] Premature end of script headers: login.php

Thanks.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Do you have homeloader.so enabled in your /usr/local/lib/php.ini file on the machine in question?
 

boonjackmedia

Active Member
Apr 28, 2010
35
1
56
Cincinnati, OH USA
Do you have homeloader.so enabled in your /usr/local/lib/php.ini file on the machine in question?
Tristan, if he had homeloader.so enabled would it cause a conflict? If so, what's the fix, advice?

I'm curious because I have homeloader.so and have had mod_fcgid glitches for awhile now, so I'm stalking related threads... in a good way though of course.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Here is a discussion about homeloader.so being enabled:

http://forums.cpanel.net/f5/case-44...h-php-causes-random-memory-errors-140821.html

It has been shown to cause memory errors for some scripts and other assorted errors. To quote my post in that thread:

At this time, FCGI or CGI + homeloader.so appears to cause errors and will not function. Please note that the homeloader.so module for PHP is used by the "Magic User Loader" module, which is set in WHM > Software Module Installers PHP Extensions and Applications area. It would be enabled by selecting the "Magic User Loader" option. The purpose of the module would be so that users do not have to enter in the full include path for PEAR modules, but PEAR modules will still work without using this module.
My advice would be to comment out the module in your php.ini and see if the errors quit happening. It shouldn't be used with FCGI.
 

imploder303

Registered
Sep 29, 2004
4
0
151
Hi,

I finally solved this issue, PRM was the culprit, killing PHP processes. Because of the nature of FCGI, they tend to grow in memory use, so they would get killed with those results.
Bottom line, processes managers like these should be configured or avoided.
FCGI works well with some configuration, though, as CPanel staff states, should be avoided by unexperienced users, specially if traffic is uneven between hosted sites, requiring special vhost parameters to avoid "process slot" problems.

I tested mod_fcgid 2.3.6 too, but it doesn't respect vhost parameters so it tends to go unstable, so I don't recommend it.

Thanks Tristan and all for your kind support, I hope this helps anyone with this problem in the future.
 

SherifBuzz

Member
Dec 2, 2010
20
0
51
Please provide us with more details - which PRM are you referring to, what steps did you take to resolve the issue.

This is a common problem and as much detail as possible would go a long way to helping others.
 

SherifBuzz

Member
Dec 2, 2010
20
0
51
Thank you, is this included by default ? I'm pretty sure I don't have it running.

I am having the same issues as in this thread and have hit a brick wall trying to fix it. Are there any other leads on how to resolve this issue ?