You can download a Perl language interpreter first, download the. msi suffix file (your own Internet load one installation package), double-click the mouse to run it, this is a WindowsInstaller packge format installation package,
all the way next down on it. Here's how to support Perl in Apache:
1. Enter Apache's conf directory to open the httpd.conf file in text format.
2. Find the ServerName, remove the front # and replace it with your host name (generally with localhost). Of course, some versions have been set up, then you do not move.
3. Find #ScriptAlias/cgi-bin/"d:/web/apache/cgi-bin/", remove the front # (as for the installation path each Apache version of the installation path is slightly different, The path is set according to your condition.
4. Find AddHandler cgi-script. CGI, followed by a space and. pl. That is, AddHandler cgi-script. cgi. PL
5. Find <directory "D:/web/apache/cgi-bin", there is a sentence below allowoverride, Remove the following parameters and change to all.
that is:
The code is as follows |
Copy Code |
<directory "D:/web/apache/cgi-bin" > AllowOverride All Options None Order Allow,deny Allow from all </Directory> |
Find: Options Indexes followsymlinks modified to options Indexes followsymlinks execcgi
In order for Apache to be able to handle server Side include, add in httpd.conf:
AddType text/html. shtml
AddHandler server-parsed. shtml
5. In order for the above modifications to take effect, you need to restart Apache
Put the following code
The code is as follows |
Copy Code |
#!c:/perl/bin/perl.exe ## # # PRINTENV--Demo CGI program which just prints its environment ##
print "Content-type:text/plain; Charset=iso-8859-1nn "; foreach $var (Sort (keys (%env))) { $val = $ENV {$var}; $val =~ s|n|\n|g; $val =~ s| "| \ "|G; Print "${var}=" ${val} "n"; } |
Save as test.pl file into the root directory to run, showing system-related information, see this shows that you installed success, at this time the system Properties-> environment variables in the path of the Perl