Chinaunix

标题: 求助 lighttpd 的 php-cgi 起不来 [打印本页]

作者: zionsaint    时间: 2009-05-07 11:06
标题: 求助 lighttpd 的 php-cgi 起不来
lighttpd.conf相关内容:
  1. server.modules              = (
  2.                                "mod_rewrite",
  3.                                "mod_redirect",
  4.                                 "mod_access",
  5.                                "mod_fastcgi",
  6.                                "mod_compress",
  7.                                 "mod_accesslog" )

  8. fastcgi.server             = ( ".php" =>
  9.                                ( "localhost" =>
  10.                                  (
  11.                                    "socket" => "/tmp/php.socket",
  12.                                    "bin-path" => "/srv/php5/bin/php-cgi"
  13.                                  )
  14.                                )
  15.                             )
复制代码


lighttpd 的出错日志:
  1. 2009-05-06 14:32:12: (log.c.97) server started

  2. 2009-05-06 14:32:12: (mod_fastcgi.c.1051) the fastcgi-backend /srv/php5/bin/php-cgi failed to start:

  3. 2009-05-06 14:32:12: (mod_fastcgi.c.1055) child exited with status 127 /srv/php5/bin/php-cgi

  4. 2009-05-06 14:32:12: (mod_fastcgi.c.1058) 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 http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI#preparing-php-as-a-fastcgi-programIf this is PHP on Gentoo, add 'fastcgi' to the USE flags.

  5. 2009-05-06 14:32:12: (mod_fastcgi.c.1365) [ERROR]: spawning fcgi failed.

  6. 2009-05-06 14:32:12: (server.c.902) Configuration of plugins failed. Going down.
复制代码


spawn-fcgi:

#/srv/lighttpd/bin/spawn-fcgi -p 1026 -f /srv/php5/bin/php-cgi -u www
出错: spawn-fcgi.c.230: child exited with: 127
不加-u参数
spawn-fcgi.c.207: child spawned successfully: PID: 22186

#php-cgi -v
PHP 5.2.8 (cgi-fcgi) (built: May  6 2009 02:00:49)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

php编译安装的时候已经加了
--enable-fastcgi --enable-force-cig-redirect

php.ini:
cgi.fix_pathinfo=1


搜了很多好像没有多少这方面的资料,着急啊……
作者: ziggler    时间: 2009-05-07 11:12
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 http://trac.lighttpd.net/trac/wi ... a-fastcgi-programIf this is PHP on Gentoo, add 'fastcgi' to the USE flags.

这说的很明白了啊
作者: zionsaint    时间: 2009-05-07 11:20
标题: 回复 #2 ziggler 的帖子
lighttpd的日志里面的意思是说我的php不支持fastcgi
我没有查到具体的资料,但是lighttpd的文档应该比较陈旧,针对的是php4,那时php-cgi还没有分离出来,php5之后的某个版本开始把php-cgi做成了单独的程序,运行php-cgi -v的结果如下
#php-cgi -v
PHP 5.2.8 (cgi-fcgi) (built: May  6 2009 02:00:49)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

其中的 (cgi-fcgi)  说明应该已经能支持fastcgi了,而且spawn-fcgi不加-u参数也可以把php-cgi起起来,还是觉得问题出在-u参数上
作者: ziggler    时间: 2009-05-07 11:28
标题: 回复 #3 zionsaint 的帖子
可以看看这个 -u参数是干吗使的?
作者: zionsaint    时间: 2009-05-07 11:31
标题: 回复 #4 ziggler 的帖子
切换uid的
作者: ziggler    时间: 2009-05-07 12:18
标题: 回复 #5 zionsaint 的帖子
那就是切换后的UID有问题?权限?
作者: 一刀砍死    时间: 2009-05-11 23:43
。。。。。。。。。。

[ 本帖最后由 一刀砍死 于 2009-5-11 23:44 编辑 ]




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2