- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我对 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/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
这是 php 构建命令行:
./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 来测试我的网络服务器:
<? php
phpinfo();
?>
附言:
如果我删除
$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.conf,lighttpd 成功启动并且 Firefox 显示 index.html(但不是 index.php):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Yabaaa!!!</title>
</head>
<body>
HELLO!!!
</body>
</html>
更新:
感谢您的回复。
lighttpd_error.log 准确地说是 FCGI 和 PHP 解释器有问题。
是的,向后移植在 SUSE 或 Ubuntu 上可用,但它们也不起作用。
我认为是操作系统问题。
我有嵌入式设备:
CPU: AMD AU1000 (MIPS platform, not x86)
RAM: 64 MB
HDD: 120 GB
LAN: ethernet controller
为此设备构建应用程序的交叉编译器:
mipsel-linux-gcc
因此,我为 MIPS 目标构建了 Lighttpd 和 php,将它们复制到此设备,然后...服务器开始正常工作。我可以看到来自 Mozilla 的 index.php!
我不知道为什么Lighttpd+PHP不能在PC上运行。
决定:我对这个问题打分。
最佳答案
If I remove
$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"}
from lighttpd.conf, lighttpd successfully starts and Firefox displays index.html
这可能是一个不同的问题,这里只涉及 SSL 和日志文件。这些日志文件是否存在?有关 SSL key 文件的信息在哪里?
我通常更喜欢使用预构建包。是否没有可用于 SuSE 或 Ubuntu 的向后移植?
关于php - Lighttpd + PHP + FCGI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1353311/
app = redmine-2.0.1 ruby = ruby 1.9.3p194(2012-04-20 修订版 35410)[x86_64-linux] [root@by1016690 publ
我是新手,如果这听起来很天真,请原谅我。我用 fastcgi++ 写了一个脚本。我测试了基本用例。但作为一名优秀的软件工程师,我想在每次进行更改时测试脚本,以确保我不会破坏任何东西。 这是我以前做的:
我在使用 nginx 使 FCGI 应用程序在 C 中工作时遇到问题。我正在使用 spawn-fcgi 创建套接字并运行我的应用程序(我将其命名为 paste) 我想这一定是我的应用程序有问题,但我很
我正在尝试在共享托管服务提供商上设置 django。我按照 http://helpdesk.bluehost.com/index.php/kb/article/000531 上的说明进行操作 几乎让它
我正在 lighttpd +FCGI 上运行 django 安装。除了管理员之外,一切正常。 我发布某些内容(即我修改或创建模型的实例)后的重定向似乎出错了。 管理员不断将我重定向到 www.xyz.
我有一个用 C 语言编写的 FCGI 应用程序。我们遇到过客户端关闭事件连接的情况,即在页面加载期间离开页面——如果可能的话,我们希望在应用程序中检测到这一点。我们将 Web 服务器 (nginx)
我正在使用 C。例如,我如何发送 404 响应? 最佳答案 包括 Status: 404 Not Found 在您为响应生成的 header 中。 关于c - 如何在 fcgi 程序中设置状态代码?,
我目前正在尝试实现一个在 Linux 上运行的小型 FastCGI 多线程应用程序。我使用来自 fastcgi.com 的库.现在我不确定我是否真的理解 web 服务器和我的应用程序之间的 FCGI
我最近安装了一台新的 ubuntu 机器,带有 wordpress、spawn-fcgi 和 nginx。 每天早上,我都会尝试查看我的博客,但我收到 502 错误网关错误。 我试图找到一些关于为什么
我对 Lighttpd、PHP 和 CGI 有疑问。 我使用的是 OpenSUSE.10。 我已经构建了 lighttpd(版本 1.4.23)和 php(版本 5.3.0)。 这是 lightt
我正在按照说明安装 get 以克隆存储库,然后突然间我开始收到“bin/magento 必须作为 CLI 应用程序运行”错误。 当我执行 php -v 时,它显示: ea-php-cli Copyri
我正在按照 this steps 部署一个 Django 项目 我的 .htaccess 是: AddHandler fcgid-script .fcgi RewriteEngine On Rewri
我对 nginx 和 Perl FCGI 模块有一点问题。我的 FCGI 程序中有一个很长的操作,它可能比我用来通信 FCGI 的 Unix 套接字另一端的服务器(或服务器上的用户)生命周期更长。如果
我使用 fastcgi.com 的 API 用 C 编写了一个 FCGI 程序。我已经像文档所说的那样调用了 FCGI_Accept。当我运行生成的可执行文件时,它就像 CGI 程序一样运行,然后退出
如果这是一个明显的问题,我很抱歉,但我真的束手无策试图解决这个问题。 我有一个 Django 应用程序,它作为 fcgi 进程运行,并使用 Lighttpd 作为前端服务器。 我首先尝试按照文档中的建
我正在使用 django 为客户构建一个网站。它托管在共享主机上,无法使用 mod_wsgi。去年,我使用 fcgi 让它工作,但是当我回来时,它坏了。 我用一个简单的 hello world 脚本替
我想用 C++11 使用 fcgi 和 nginx 编写一个网站。目前只有结合 libc++ 的 Clang++ 完全支持 C++11。 但是当我运行我的 fcgi 程序时,当有人通过浏览器请求页面时
我遇到了一个问题,我不知道如何调试一个用 C++ 编写的基于 fastcgi 的 FCGI 程序。 . 程序由Lighttpd管理spawn-fcgi并由 nginx fastcgi 模块调用。 我写
我正在尝试通过 lighttpd + fcgi 部署我的 django 应用程序,但是当我运行 fcgi 脚本时,它给我一个错误 这是 fcgi 脚本本身: #!/usr/bin/python2.6
我正在尝试使用 mod_fascgi 和 perftools 分析在 apache 中运行的 fcgi 应用程序 (C++) >。所以是 Centos 6 x86_64。 问题如下。根据gperfto
我是一名优秀的程序员,十分优秀!