[四年前的博客了,还在用windows的我,还在对服务器端如何更轻的提供服务来奋斗~哈哈]
apache version 2.2.17
安装好后浏览http://localhost/,显示It works,说明apache http server起来了,再验证对perl的支持。
发现cgi-bin/printenv.pl,对其进行访问http://localhost/cgi-bin/printenv.pl,显示Internal Server Error 500,说明Perl没有被解析正确,查看printenv.pl如下:
#!C:/perl/bin/perl.exe
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";
}
修改为#!E:/cygwin/bin/perl.exe<--这里#!符号(colloquially known as the shebang line),即真正perl所在位置即可。
重新查看http://localhost/cgi-bin/printenv.pl,打印出了环境变量如下:
COMSPEC="C:\WINDOWS\system32\cmd.exe" DOCUMENT_ROOT="C:/P