the fastcgi-backend failed to start

lighttpd + FastCGIRuby on Railsアプリケーションを動かそうとして、今日2回も↓のエラーを見かけた。


2008-09-22 03:30:53: (log.c.75) server started
2008-09-22 03:30:53: (mod_fastcgi.c.1029) the fastcgi-backend /var/www/skip/public/dispatch.fcgi failed to start:
2008-09-22 03:30:53: (mod_fastcgi.c.1033) child exited with status 1 /var/www/skip/public/dispatch.fcgi
2008-09-22 03:30:53: (mod_fastcgi.c.1036) If you're trying to run PHP as a FastCGI backend, make sure you're using 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 this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2008-09-22 03:30:53: (mod_fastcgi.c.1340) [ERROR]: spawning fcgi failed.
2008-09-22 03:30:53: (server.c.908) Configuration of plugins failed. Going down.


  • 1回目は、shebangを書き間違えていた
  • 2回目は、require文を書き間違えていた


ちなみに、↑のlighttpd + FastCGIの環境のままデバッグすると非常に原因が追いづらいので、原因を切り分ける際は、一旦WebrickMongrelで稼動させながら、エラーを再現させて原因を探るのが良いと思います。