Windows lets Apache support the implementation of Perl

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.