編輯:C:\AppServ\Apache2.2\conf\httpd.conf
搜尋:ScriptAlias /cgi-bin/ "C:/AppServ/www/cgi-bin/"
改為:ScriptAlias /*/ "C:/AppServ/www/"
搜尋:<Directory "C:/AppServ/www/cgi-bin">
改為:<Directory "C:/AppServ/www">
搜尋:Options None
改為:Options +Indexes +ExecCGI
搜尋:#AddHandler cgi-script .cgi
改為:AddHandler cgi-script .cgi
※就是把 # 刪除
都改完以後就存檔,然後重新運作伺服器,接下來就可以在www的 目錄下直接執行CGI Game
不會有限制說*.cgi、*.pl檔案只限定在cgi-bin底下才能執行的困擾
C:\strawberry>perl --help
Usage: C:\strawberry\perl\bin\perl.exe (perl路徑)
#!C:\strawberry\perl\bin\perl.exe
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/html\n\n";
print "*** Please define header of file *.pl or *.cgi with
#!c:\\perl\\bin\\perl.exe\n\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
沒有留言:
張貼留言