2

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?

Chris B.
  • 337
  • 1
  • 8
  • 18

1 Answers1

1

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

$ /usr/bin/php-cgi -m
[PHP Modules]
bcmath
bz2
calendar
cgi-fcgi
...

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")?

Matt
  • 256
  • 1
  • 2