我在 Ubuntu 12.04 LTS 上运行 lighttpd/1.4.28 (ssl)。一切正常,我正在尝试进行一些性能调整。我想为 fastcgi 模块启用调试模式,但是当我添加指令时调试工具在我的配置文件中,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"
))
)
为什么无法识别该指令?即使我将其设置为零,也会出现错误。
答案1
我已经花了一个小时的时间在这个问题上,最后偶然发现了这个帖子: http://redmine.lighttpd.net/boards/2/topics/2265
在线程的最后,OP提到从控制台以交互方式运行lighttpd:
sudo lighttpd -Df /etc/lighttpd/lighttpd.conf
当我这样做时,它打印出以下消息:
Duplicate config variable in conditional 0 global: fastcgi.debug
于是我 grep 了所有配置,果然,有另一个文件包含 fastcgi.debug 指令。当我删除重复条目时,lighttpd 启动了。
lighttpd 应该将该消息写入错误日志!