Issue and solution for upgrading Lighttpd from 1.4.8 to 1.4.11

After upgrading Lighttpd to 1.4.11 from 1.4.8 it was no longer working with my Ruby on Rails project saying it couldn’t find public/dispatch.fcgi. Well, it turns out they made this security fix which breaks relative paths typically used in lighttpd.conf:

> script/server
2006-03-25 15:21:55: (mod_fastcgi.c.1022) execve failed for: public/dispatch.fcgi No such file or directory
2006-03-25 15:21:55: (mod_fastcgi.c.1048) the fastcgi-backend public/dispatch.fcgi failed to start:
2006-03-25 15:21:55: (mod_fastcgi.c.1052) child exited with status 2 public/dispatch.fcgi
2006-03-25 15:21:55: (mod_fastcgi.c.1055) if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.
You can find out if it is the right one by executing ‘php -v’ and it should display ‘(cgi-fcgi)’ in the output, NOT (cgi) NOR (cli)
For more information check
2006-03-25 15:21:55: (mod_fastcgi.c.1060) If this is PHP on Gentoo add fastcgi to the USE flags
2006-03-25 15:21:55: (mod_fastcgi.c.1356) [ERROR]: spawning fcgi failed.
2006-03-25 15:21:55: (server.c.834) Configuration of plugins failed. Going down.

For a temporary fix I just edited this file: lib/ruby/gems/1.8/gems/rails-1.0.0/configs/lighttpd.conf as well as the config/lighttpd.conf files in my existing rails project changing this line:

“bin-path” => “public/dispatch.fcgi”,

to this:

“bin-path” => CWD + “/public/dispatch.fcgi”,

I hope someone finds this useful!

This entry was posted in Ruby, Systems Administration, Web. Bookmark the permalink.

7 Responses to Issue and solution for upgrading Lighttpd from 1.4.8 to 1.4.11

  1. Dan K. says:

    Indeed, someone did! Thanks for the hint!

  2. Li says:

    worked for me too, though I only changed the config/lighttpd.conf on my web application because I can’t find the first file you were talking about. Everything works fine! Thanks 🙂

  3. Simon says:

    Rockin’. Just beat my head on exactly this issue for a couple of hours before hitting this. thanks

  4. Eric Watson says:


  5. Chris says:

    Hmm, I got the same error but all my lighttpd.conf files already had “bin-path” => CWD + “/public/dispatch.fcgi”,

  6. Drew Noakes says:

    I’d hoped that this would help me out, but as with Chris above, my conf file already has the CWD prepend, so I’m stuck for now…

  7. This seems to happen when the shebang line of the dispatcher script doesn’t reference to an existing interpreter.

    Find the corresponding first line in the dispatch.fcgi file, e.g.:


    and test if the interpreter is to be found there. If not, change it to the right path, e.g.:


    The error message for wrong shebang lines is generally a bit misleading, as it suggests that the script file itself is not found – even if it’s only the referenced interpreter that is missing.

Leave a Reply

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