我在 Ubuntu 12.04 LTS 上运行 lighttpd/1.4.28 (ssl)。一切正常,我正在尝试进行一些性能调整。我想为 fastcgi 模块启用调试模式,但是当我将指令fastcgi.debug添加到我的 conf 文件时,lighttpd 因“解析器失败”错误而窒息:
2013-10-08 10:56:23: (configfile.c.912)
source: /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
line: 1
pos: 15 parser failed somehow near here: (EOL)
配置文件是:/etc/lighttpd/conf-enabled/15-fastcgi-php.conf
fastcgi.debug=1
fastcgi.server += ( ".php" =>
((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket",
"max-procs" => 1, # runs max-procs bin-path controllers plus (max-procs * PHP_FCGI_CHILDREN) workers
"idle-timeout" => 20,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "10",
# PHP_FCGI_MAX_REQUESTS: The number of requests that a single worker handles before it kills itself.
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
"bin-copy-environment" => (
"PATH", "SHELL", "USER"
),
"broken-scriptfilename" => "enable",
"check-local" => "disable"
))
)
为什么指令不被识别?即使我将其设置为零,我也会收到错误消息。
我花了最后一个小时,终于跑到这个线程: http ://redmine.lighttpd.net/boards/2/topics/2265
在线程的最后,OP 提到从控制台以交互方式运行 lighttpd:
当我这样做时,它打印出消息:
所以我 grep 了我所有的配置,果然,还有另一个带有 fastcgi.debug 指令的文件。当我删除 dup 条目时,lighttpd 启动了。
lighttpd 应该将该消息写入错误日志!