perl 5.8在apache2.0.54下的配置问题

tntxhy 2005-06-30 12:06:49
环境为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
这个是配置的代码,哪里有问题吗?
...全文
66 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
enctype 2005-07-04
  • 打赏
  • 举报
回复

<Directory "D:/Program Files/Apache Group/Apache2/htdocs">

下,还要有这么一行
Options Indexes FollowSymLinks ExecCGI

2,204

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 CGI
社区管理员
  • CGI社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧