我尝试启用我的lighttpd服务器(在Ubuntu上运行)中的mod_fastcgi ,使用以下configuration(直接从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" ))
)
…但是现在lighttpd无法在日志中的以下内容开始:
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.
我怎么知道出了什么问题,并解决它?
我会看看我能不能帮忙,但请记住,我没有一个简单的设置,所以我不能比较一对一。
我想你应该看看你的php-cgi是如何configuration的以及它会支持什么。 所以…也许从…开始
$ which php-cgi /usr/bin/php-cgi $ /usr/bin/php-cgi -m [PHP Modules] bcmath bz2 calendar cgi-fcgi ...
那么也许:
$ /usr/bin/php-cgi -i > phpcgi.html
然后,在浏览器中打开phpcgi.html。 我怀疑phpcgi.html和phpcgi-m应该都提到“ cgi-fcgi ”或Server API CGI / FastCGI等。
如果这两个看起来不错(即,看起来像设置为支持CGI),那么我会开始selectlightty设置和/etc/php5/cgi/*.ini文件。
我目前正在运行一个Nginx / spawn-fcgi / PHP5设置,效果很好。
你运行的是哪个Ubuntu(cat / etc / issue),哪个体系结构(uname -a)以及哪个lighttpd / php / fastcgi包(dpkg –list | egrep“lighttpd | fastcgi | php”)?