Install and configure Perl Apache in Windows XP

Source: Internet
Author: User
Install and configure Perl in Windows XP
Download:
Apache 1.3.29:
ActivePerl: http://activestate.com/store/download.aspx? Prdguid = 81fbce82-6bd5-49bc-a915-08d58c2648ca
Go to view archive of older releases download ActivePerl-5.6.1.624-TRIAL2-MSWin32-x86-multi-thread.msi
Mod_perl: http://perl.apache.org/download/index.html
Mod_perl 1.0: Version 1.30 for use with Apache 1.3.x (installation instructions are provided at the same time, but detailed enough)

1) double-click the ActivePerl-5.6.1.624-TRIAL2-MSWin32-x86-multi-thread.msi according to the installation wizard to install. For example, the last installation path is c: \ Perl \ bin.
Test in command line
C: \ Documents ents and Settings \ User> Perl-V
If the version number is displayed normally, the installation is successful.

2. Compile and obtain mod_perl.so;to decompress mod_perl-1.0-current.tar.gz and go to the directory for execution:
C: \ modperl_src> Perl makefile. pl apache_src = installation directory of Apache
(E.g.: F: \ mod_perl-1.0-current \ mod_perl-1.30> Perl makefile. pl apache_src = E: \ APAC
He1329 \ apache)
Then execute (the nmake command must install microsofe visual c ++ 5.0 or above ):
C: \ modperl_src> nmake
C: \ modperl_src> nmake Test
C: \ modperl_src> nmake install
The mod_perl.so file will be obtained under the modules directory of Apache.
3) Apache to support Perl
Add the following two lines to the end of the httpd. conf file # dynamic shared object (DSO) Support segment:
Loadmodule perl_module modules/mod_perl.so
LoadFile "C:/perl/bin/perl56.dll"

Add the following lines to the end of # reconstruction of the complete module list from all available modules:
Addmodule mod_perl.c

Find # addhandler CGI-script. cgi and change it
Addhandler CGI-script. pl. cgi

Find the <ifmodule mod_alias.c> section and add a directory element to the above virtual directory:
<Directory "E:/proj/PHP">
AllowOverride all
Options indexes primary des execcgi
</Directory>

Note:
Generally, users prefer to write in Perl files.
#! /Usr/bin/perl
Most of the reason for writing this is to be compatible with Linux (UNIX ).
But assume that your perl directory is c: \ USR \ bin, and the Apache directory is D: \ apache2. then all yourProgramThe first line must be

1 .#! C:/usr/bin/perl.exe
2 .#! Usr/bin/perl
3 .#! Perl

One of the three types. C: \ USR \ bin must be added to the path in the 3rd types.
If you do not do this, when your scheme class is like http: // localhost/cgi-bin/printenv. pl (this program takes #! When/usr/bin/perl starts, an error is returned (view Apache logs ):

No such file or directory: Couldn't spawn child process: D:/apache2/cgi-bin/printenv. pl

The solution to this problem is not to modify httpd. conf or the registry. You can use both #! C:/usr/bin/perl.exe or install Apache and Perl in a directory (both in C: or in D :)

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.