Lighttpd&x2B;PHP+;FCGI
我对Lighttpd、PHP和CGI有问题 我使用OpenSUSE.10 我已经构建了lighttpd(版本1.4.23)和php(版本5.3.0) 这是lighttpd生成命令行:Lighttpd&x2B;PHP+;FCGI,php,cgi,lighttpd,fastcgi,Php,Cgi,Lighttpd,Fastcgi,我对Lighttpd、PHP和CGI有问题 我使用OpenSUSE.10 我已经构建了lighttpd(版本1.4.23)和php(版本5.3.0) 这是lighttpd生成命令行: ./configure --prefix=/home/gosh/Desktop/web_server/lighttpd_native_installed --without-zlib --enable-ssl --enable-openssl --with-openssl=/home/gosh/Desktop/we
./configure --prefix=/home/gosh/Desktop/web_server/lighttpd_native_installed --without-zlib --enable-ssl --enable-openssl --with-openssl=/home/gosh/Desktop/web_server/openssl_native_installed --with-openssl-includes=/home/gosh/Desktop/web_server/openssl_native_installed/include --with-openssl-libs=/home/gosh/Desktop/web_server/openssl_native_installed/lib --without-pcre --with-zlib --without-bzip2
make
make install
./configure --prefix=/home/gosh/Desktop/web_server/php_native_installed --without-iconv --disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear --enable-fastcgi --enable-force-cgi-redirect
make
make install
这是php构建命令行:
./configure --prefix=/home/gosh/Desktop/web_server/lighttpd_native_installed --without-zlib --enable-ssl --enable-openssl --with-openssl=/home/gosh/Desktop/web_server/openssl_native_installed --with-openssl-includes=/home/gosh/Desktop/web_server/openssl_native_installed/include --with-openssl-libs=/home/gosh/Desktop/web_server/openssl_native_installed/lib --without-pcre --with-zlib --without-bzip2
make
make install
./configure --prefix=/home/gosh/Desktop/web_server/php_native_installed --without-iconv --disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear --enable-fastcgi --enable-force-cgi-redirect
make
make install
这是php,php cgi-v:
gosh@suse:~/Desktop/web_server> /home/gosh/Desktop/web_server/php_native_installed/bin/php -v
PHP 5.3.0 (cli) (built: Aug 30 2009 03:56:22)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
gosh@suse:~/Desktop/web_server> /home/gosh/Desktop/web_server/php_native_installed/bin/php-cgi -v
PHP 5.3.0 (cgi-fcgi) (built: Aug 30 2009 03:55:55)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
gosh@suse:~/Desktop/web_server>
这是lighttpd.conf:
server.document-root = "/home/gosh/Desktop/web_server"
server.port = 81
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
index-file.names = ( "index.php" )
server.modules = (
"mod_fastcgi",
"mod_accesslog"
)
accesslog.filename = "/home/gosh/Desktop/web_server/lighttpd_access0.log"
server.accesslog = "/home/gosh/Desktop/web_server/lighttpd_access000.log"
fastcgi.debug = 1
fastcgi.server = (
".php" =>
((
"bin-path" => "/home/gosh/Desktop/web_server/php_native_installed/php-cgi -c /home/gosh/Desktop/web_server/php.ini",
"socket" => "php.socket"
)),
".html" =>
((
"bin-path" => "/home/gosh/Desktop/web_server/php_native_installed/php-cgi -c /home/gosh/Desktop/web_server/php.ini",
"socket" => "php.socket"
))
)
$SERVER["socket"] == "127.0.0.1:443" {
server.document-root = "/home/gosh/Desktop/web_server"
ssl.engine = "enable"
ssl.pemfile = "/home/gosh/Desktop/web_server/lighttpd.pem"
server.errorlog = "/home/gosh/Desktop/web_server/lighttpd_error.log"
server.accesslog = "/home/gosh/Desktop/web_server/lighttpd_access1.log"
accesslog.filename = "/home/gosh/Desktop/web_server/lighttpd_access2.log"
}
这是启动lighttpd的命令行:
sudo /home/gosh/Desktop/web_server/lighttpd_native_installed/sbin/lighttpd -f /home/gosh/Desktop/web_server/lighttpd.conf -m /home/gosh/Desktop/web_server/lighttpd_native_installed/lib
最后,lighttpd创建lighttpd_error.log:
2009-08-30 04:44:01: (log.c.172) server started
2009-08-30 04:44:01: (mod_fastcgi.c.1365) --- fastcgi spawning local
proc: /home/gosh/Desktop/web_server/php_native_installed/php-cgi -c /home/gosh/Desktop/web_server/php.ini
port: 0
socket php.socket
min-procs: 4
max-procs: 4
2009-08-30 04:44:01: (mod_fastcgi.c.1390) --- fastcgi spawning
port: 0
socket php.socket
current: 0 / 4
2009-08-30 04:44:01: (mod_fastcgi.c.1087) the fastcgi-backend /home/gosh/Desktop/web_server/php_native_installed/php-cgi -c /home/gosh/Desktop/web_server/php.ini failed to start:
2009-08-30 04:44:01: (mod_fastcgi.c.1091) child exited with status 2 /home/gosh/Desktop/web_server/php_native_installed/php-cgi -c /home/gosh/Desktop/web_server/php.ini
2009-08-30 04:44:01: (mod_fastcgi.c.1094) 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.
2009-08-30 04:44:01: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2009-08-30 04:44:01: (server.c.928) Configuration of plugins failed. Going down.
我的问题是:
1) 有没有人在Ubuntu或OpenSUSE上成功启动lighttpd+PHP+FastCGI的经验
2) 为什么生成fcgi失败
也就是说,我想使用index.php来测试我的web服务器:
<? php
phpinfo();
?>
从lighttpd.conf,lighttpd成功启动,Firefox显示index.html(但不是index.php):
此设备的内置应用程序的交叉编译器:
mipsel-linux-gcc
所以,我为MIPS目标构建了Lighttpd和php,将它们复制到这个设备上,然后。。。服务器开始正常工作。我可以从Mozilla中看到index.php
我不知道为什么Lighttpd+PHP不能在PC上工作
决定:我在这个问题上得分。不确定,但大多数安装指南都说你应该在php.ini的末尾添加这个
cgi.fix_pathinfo = 1
如果我删除
$SERVER[“socket”]=“127.0.0.1:443”{
server.document-root=“/home/gosh/Desktop/web_server”
ssl.engine=“启用”
ssl.pemfile=“/home/gosh/Desktop/web_server/lighttpd.pem”
}
从lighttpd.conf,lighttpd
成功启动并启动Firefox
显示index.html
这可能是另一个问题,这里只涉及SSL和日志文件。
这些日志文件存在吗?
关于SSL密钥文件的信息在哪里
我通常更喜欢使用预构建的包。SuSE或Ubuntu是否没有可用的后端端口 在ubuntu上,我注意到php cgi二进制文件的路径设置没有使用真正的二进制文件名,ubuntu安装php5 cgi作为默认配置尝试指向php cgi,因此出现上述错误。我自己猜了几分钟。谢谢你的回复。但是您提供的解决方案并没有解决问题(我已经绝望地遵循了这个建议…这是我的php.ini:extension\u dir=/home/gosh/Desktop/web\u server authorization\u state=false cgi.fix\u pathinfo=1
cgi.fix_pathinfo = 1
server.errorlog = "/home/gosh/Desktop/web_server/lighttpd_error.log"
server.accesslog = "/home/gosh/Desktop/web_server/lighttpd_access1.log"
accesslog.filename = "/home/gosh/Desktop/web_server/lighttpd_access2.log"