I am getting this error inside a PHP (Drupal) application:

(104)Connection reset by peer: FastCGI: comm with server "/opt/php-5.2.5/bin/php-cgi" aborted: read failed

It's frequently adopted with this error:

FastCGI: incomplete headers (0 bytes) received from server "/opt/php-5.2.5/bin/php-cgi"

The fundamental Apache configuration for PHP appears like this:

   FastCgiServer /opt/php-5.2.5/bin/php-cgi -initial-env PHP_FCGI_CHILDREN=32
   ScriptAlias /fcgi-bin/php-5.2.5 /opt/php-5.2.5/bin/php-cgi
   <Location /fcgi-bin/php-5.2.5>
     Options +ExecCGI
     SetHandler fastcgi-script
     SetOutputFilter INCLUDES
   </Location>
   # send php5.2-fastcgi handler to our scriptalias
   Action php-5.2.5-fastcgi /fcgi-bin/php-5.2.5

Now, my fundamental real question is, do you know the general reasons for the "comm with server" error? During this situation, the mistake seems occasionally, but certain pages generate it more frequently than the others. Let me understand what to search for when debugging my code.

During this problem, it had been associated with a strange bug during my code... it appears some types of errors cause FastCGI to fail badly it does not forward around the underlying PHP code error. Sorry I do not convey more detail for individuals individuals going to from Google.

What is the character set you are using? I have read that many people is getting issues if their application is applying another character set.

Take a look at this

Sorry I can not find better results.

I'd exactly the same problem however in python and that i resolved altering the extention of my script to .py

#.htaccess file
AddHandler fastcgi-script .py