免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4940 | 回复: 6
打印 上一主题 下一主题

[Web] 求助 lighttpd 的 php-cgi 起不来 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-07 11:06 |只看该作者 |倒序浏览
20可用积分
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


搜了很多好像没有多少这方面的资料,着急啊……

论坛徽章:
0
2 [报告]
发表于 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.

这说的很明白了啊

论坛徽章:
0
3 [报告]
发表于 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参数上

论坛徽章:
0
4 [报告]
发表于 2009-05-07 11:28 |只看该作者

回复 #3 zionsaint 的帖子

可以看看这个 -u参数是干吗使的?

论坛徽章:
0
5 [报告]
发表于 2009-05-07 11:31 |只看该作者

回复 #4 ziggler 的帖子

切换uid的

论坛徽章:
0
6 [报告]
发表于 2009-05-07 12:18 |只看该作者

回复 #5 zionsaint 的帖子

那就是切换后的UID有问题?权限?

论坛徽章:
0
7 [报告]
发表于 2009-05-11 23:43 |只看该作者
。。。。。。。。。。

[ 本帖最后由 一刀砍死 于 2009-5-11 23:44 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP