perl 5.8在apache2.0.54下的配置问题
环境为windows
#!c:/perl/bin/Perl.exe
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain; charset=iso-8859-1\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
这个程序没问题,运行正确。
#!c:\perl\bin\perl.exe
# ^^^ this must be the first line of the script! ^^^
# start code
use strict;
use CGI;
my $q = new CGI;
# print header and start the markup output
print $q->header( "text/html" ),$q->start_html( "hello from perl cgi!" );
print $q->h2("hello dave...");
print $q->end_html;
# end code
这个程序就出500错误。我在命令行下执行这个程序是没有问题的。是不是apache配置的问题?
<Directory "F:/wwwroot">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
...
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
这个是配置的代码,哪里有问题吗?