(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server


I have been battling with this problem for quite a while now. This issue comes up randomly while using Magento (and everytime while I run stock management script for it which should run quite a while). Seems there’s some setting for fastcgi which limits the time but I have tried to change every possible limit in PHP.INI (yes I change the correct one) and virtualmin backend website options for the site to unlimited so I’m completely out of ideas what to do anymore. All I can find from logs is:

(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server.

That is all.

Any ideas what could cause this and what I could try to solve the problem?


Well, it could mean Magento is erroring out for some reason, though it’s difficult to tell why that might be.

One thing you could try is to change the PHP Execution Mode, in the hopes that it either resolves the issue, or at least results in a better error message.

To do that, you can go into Server Configuration -> Website Options, and set “PHP Execution Mode” to “CGI”.


That helped indeed. Thanks!

Does that slow the site down though?

Possibly… you may need to do some testing to see how it affects your site.

While FCGID should be faster – it’s often only faster by a non-noticeable amount :slight_smile:

Some folks end up needing to use CGI, as their web apps aren’t compatible with FCGID for some reason.

In theory, Magento should work with FCGID, and I’m not sure why it isn’t – but there’s no shame in using CGI if that’s what works :slight_smile: