问题是我的.pl脚本被下载为空文件而不是被执行。我阅读了:http://redmine.lighttpd.net/wiki/lighttpd/ApplicationsUsingLighttpd。我的dispatch.fcgi如下所示:(它位于usr/bin/)
#!perl
#!/usr/bin/perl
use strict;
use CGI::Fast;
use Embed::Persistent; {
my $p = Embed::Persistent->new();
while (new CGI::Fast) {
my $filename = $ENV{SCRIPT_FILENAME};
my $package = $p->valid_package_name($filename);
my $mtime;
if ($p->cached($filename, $package, \$mtime)) {
eval {$package->handler;};
}
else {
$p->eval_file($ENV{SCRIPT_FILENAME});
}
}
}
这是我在lighttpd配置文件中的代码:
".pl" =>
((
"fastcgi.debug" => 1,
"bin-path" => "/usr/bin/dispatch.fcgi",
"socket" => "/tmp/fcgi.socket",
"check-local" => "disable",
"min-procs" => 1,
"max-procs" => 5,
"idle-timeout" => 20
))
我需要安装CGI.pm和cpan模块嵌入。现在我的服务器日志中没有任何错误,但是如我所说,脚本只是下载。
谢谢你的帮助!