Premature end of script headers with PHP and FastCGI

By | August 25, 2013

One of the websites I host the other day decided to stop working, and I encountered an issue I had not seen before.  After some investigation I found these in the error_log from httpd.

[Sun Aug 25 03:13:10 2013] [warn] [client www.xxx.yyy.zzz] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sun Aug 25 03:13:10 2013] [error] [client www.xxx.yyy.zzz] Premature end of script headers: support.php
[Sun Aug 25 03:13:10 2013] [warn] [client www.xxx.yyy.zzz] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sun Aug 25 03:13:10 2013] [error] [client www.xxx.yyy.zzz] Premature end of script headers: support.php

As it turned out, it had nothing to do with the fact that scripts were dying early, or the site got hacked.  None of that.  The process limit had been hit for that user.  It turns out that a cronjob had been stalling before closing and had used up all available processes for that user.  By, simply killing off the stalled cronjobs, the website immediately came back.  I then disabled the cronjob until the third party data provider came back up.

I hope this helps someone.

Leave a Reply

Your email address will not be published. Required fields are marked *