Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

php 5.4.7 via mod_fcgi

when I run the site sometimes it works, sometimes it crashed with 500 Internal Error, this is what I see in error.log everytime I run the script

[Mon Sep 24 18:50:43 2012] [warn] [client] (104)Connection reset by peer:   mod_fcgid: error reading data from FastCGI server
[Mon Sep 24 18:50:43 2012] [error] [client] Premature end of script headers: api.php

any ideas?

vhost config:

<VirtualHost :80>
DocumentRoot "/home/www/sites/"
ErrorLog "/home/www/sites/"
CustomLog "/home/www/sites/" common

<IfModule mod_fcgid.c>
<Directory /home/www/sites/>
  Options +ExecCGI
  AllowOverride All
  AddHandler fcgid-script .php
  FCGIWrapper /home/www/php-fcgi-scripts/php-fcgi-starter .php
  Order allow,deny
  Allow from all

FcgidMaxRequestLen 1073741824

fcgi.d conf

LoadModule fcgid_module modules/
# Use FastCGI to process .fcg .fcgi & .fpl scripts
AddHandler fcgid-script fcg fcgi fpl

# Sane place to put sockets and shared memory file
FcgidIPCDir /var/run/mod_fcgid
FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

IdleTimeout 300
BusyTimeout 300
ProcessLifeTime 7200
IPCConnectTimeout 300
IPCCommTimeout 7200

PHP_Fix_Pathinfo_Enable 1




export PHP_FCGI_TIMEOUT=1200

exec $PHP_CGI -c $PHP_INI
share|improve this question
up vote 0 down vote accepted

Turned out PHP 5.4.7 doesn't work well with recent APC module. I disabled it in php547-fastcgi.ini - and everything started to work properly

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.