apache perl

just posted @ 2009年4月29日 18:44 in web with tags apache perl , 1143 阅读

修改httpd.conf



ScriptAlias /cgi-bin/ "D:/Apache2.2/cgi-bin/"

<Directory "D:/Apache2.2/cgi-bin">
    AllowOverride All
    Options All
    Order allow,deny
    Allow from All
</Directory>


AddHandler cgi-script .cgi .pl

重启
访问:http://localhost:81/cgi-bin/printenv.pl
 

 printenv.pl:

#!D:/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";
}

 

 

 

  • 无匹配
  • 无匹配

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter