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

I tried enabling mod_fastcgi in my lighttpd server (running on Ubuntu), with the following config (straight from the example in conf-available):

fastcgi.server    = ( ".php" =>
            "bin-path" => "/usr/bin/php-cgi",
            "socket" => "/tmp/php.socket",
            "max-procs" => 2,
            "idle-timeout" => 20,
            "bin-environment" => (
                    "PHP_FCGI_CHILDREN" => "4",
                    "PHP_FCGI_MAX_REQUESTS" => "10000"
            "bin-copy-environment" => (
                    "PATH", "SHELL", "USER"
            "broken-scriptfilename" => "enable"


... but now lighttpd fails to start with the following in the logs:

2010-09-06 17:13:39: (log.c.166) server started
2010-09-06 17:13:39: (mod_fastcgi.c.1104) the fastcgi-backend /usr/bin/php-cgi failed to start:
2010-09-06 17:13:39: (mod_fastcgi.c.1108) child exited with status 2 /usr/bin/php-cgi
2010-09-06 17:13:39: (mod_fastcgi.c.1111) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version. If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2010-09-06 17:13:39: (mod_fastcgi.c.1399) [ERROR]: spawning fcgi failed.
2010-09-06 17:13:39: (server.c.931) Configuration of plugins failed. Going down.

How can I tell what's going wrong, and fix it?

share|improve this question
up vote 1 down vote accepted

I'll see if I can help, but keep in mind I don't have a lightty setup so I can't compare 1-for-1.

I guess you should see how your php-cgi is configured and what it'll support. So... maybe start with something like...

$ which php-cgi

$ /usr/bin/php-cgi -m
[PHP Modules]

Then maybe:

$ /usr/bin/php-cgi -i > phpcgi.html

Then, open phpcgi.html in a browser. I'd suspect that the phpcgi.html and the phpcgi -m should both have lines mentioning "cgi-fcgi" or Server API CGI/FastCGI, etc.

If both of those look good (ie, looks like it's setup to support CGI) then I'd start picking through the lightty setup and the /etc/php5/cgi/*.ini files.

I'm currently running an Nginx/spawn-fcgi/PHP5 setup that works pretty well.

Which Ubuntu are you running (cat /etc/issue), which architecture (uname -a), and which lighttpd/php/fastcgi packages (dpkg --list | egrep "lighttpd|fastcgi|php")?

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.