windows XP安装配置Perl Apache
生活随笔
收集整理的這篇文章主要介紹了
windows XP安装配置Perl Apache
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
windows XP安裝配置Perl
下載:
Apache 1.3.29 :
ActivePerl :http://activestate.com/store/download.aspx?prdGUID=81fbce82-6bd5-49bc-a915-08d58c2648ca
進入View archive of older releases 下載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 安裝說明,不過夠詳細)
1)雙擊ActivePerl-5.6.1.624-TRIAL2-MSWin32-x86-multi-thread.msi按照安裝向導進行安裝即可。如:最后安裝路徑為:C:\Perl\bin
在命令行測試
C:\Documents and Settings\user>perl -v
正常顯示版本號則表示安裝成功。
2)編譯獲取mod_perl.so;解壓mod_perl-1.0-current.tar.gz進入目錄執行:
C:\modperl_src> perl Makefile.PL APACHE_SRC=Apache的安裝目錄
(如:F:\mod_perl-1.0-current\mod_perl-1.30>perl Makefile.PL APACHE_SRC=E:\apac
he1329\Apache)
然后再執行(nmake命令需要安裝Microsofe Visual C++ 5.0以上):
C:\modperl_src> nmake
C:\modperl_src> nmake test
C:\modperl_src> nmake install
之后將在apache的modules目錄下得到mod_perl.so文件。
3) Apache 以加入Perl支持
在httpd.conf文件# Dynamic Shared Object (DSO) Support段的末尾加入以下兩行:
LoadModule perl_module modules/mod_perl.so
LoadFile "C:/Perl/bin/perl56.dll"
在# Reconstruction of the complete module list from all available modules段的末尾加入以下行:
AddModule mod_perl.c
找到#AddHandler cgi-script .cgi,然后修改為
AddHandler cgi-script .pl .cgi
找到<IfModule mod_alias.c>段,增加一個Directory元素對應上面的虛擬目錄如下:
<Directory "E:/proj/php">
AllowOverride All
Options Indexes Includes ExecCGI
</Directory>
注意:
一般喜歡在perl文件里寫
#!/usr/bin/perl
這么寫的很大部分原因是為了兼容 Linux(Unix).
但是假設你的 Perl 目錄為 C:\usr\bin, 而 Apache 目錄為 D:\Apache2. 那你所有的程序頭一行必須是
1. #!C:/usr/bin/perl.exe
2. #!usr/bin/perl
3. #!perl
這三種中的一種。其中第 3 種還必須得把 C:\usr\bin 加個 Path 中。
如果你不這么做,當你訪問類如 http://localhost/cgi-bin/printenv.pl(此程序以#!/usr/bin/perl開頭時) 時就會報錯(查看apache的logs):
No such file or directory: couldn't spawn child process: D:/Apache2/cgi-bin/printenv.pl
解決這個問題的方法不是修改 httpd.conf 或者注冊表什么的。你要么都用 #!C:/usr/bin/perl.exe 開頭,要么將 Apache 和 Perl 安裝到一個目錄中(都在 C: 或者都在 D:)
下載:
Apache 1.3.29 :
ActivePerl :http://activestate.com/store/download.aspx?prdGUID=81fbce82-6bd5-49bc-a915-08d58c2648ca
進入View archive of older releases 下載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 安裝說明,不過夠詳細)
1)雙擊ActivePerl-5.6.1.624-TRIAL2-MSWin32-x86-multi-thread.msi按照安裝向導進行安裝即可。如:最后安裝路徑為:C:\Perl\bin
在命令行測試
C:\Documents and Settings\user>perl -v
正常顯示版本號則表示安裝成功。
2)編譯獲取mod_perl.so;解壓mod_perl-1.0-current.tar.gz進入目錄執行:
C:\modperl_src> perl Makefile.PL APACHE_SRC=Apache的安裝目錄
(如:F:\mod_perl-1.0-current\mod_perl-1.30>perl Makefile.PL APACHE_SRC=E:\apac
he1329\Apache)
然后再執行(nmake命令需要安裝Microsofe Visual C++ 5.0以上):
C:\modperl_src> nmake
C:\modperl_src> nmake test
C:\modperl_src> nmake install
之后將在apache的modules目錄下得到mod_perl.so文件。
3) Apache 以加入Perl支持
在httpd.conf文件# Dynamic Shared Object (DSO) Support段的末尾加入以下兩行:
LoadModule perl_module modules/mod_perl.so
LoadFile "C:/Perl/bin/perl56.dll"
在# Reconstruction of the complete module list from all available modules段的末尾加入以下行:
AddModule mod_perl.c
找到#AddHandler cgi-script .cgi,然后修改為
AddHandler cgi-script .pl .cgi
找到<IfModule mod_alias.c>段,增加一個Directory元素對應上面的虛擬目錄如下:
<Directory "E:/proj/php">
AllowOverride All
Options Indexes Includes ExecCGI
</Directory>
注意:
一般喜歡在perl文件里寫
#!/usr/bin/perl
這么寫的很大部分原因是為了兼容 Linux(Unix).
但是假設你的 Perl 目錄為 C:\usr\bin, 而 Apache 目錄為 D:\Apache2. 那你所有的程序頭一行必須是
1. #!C:/usr/bin/perl.exe
2. #!usr/bin/perl
3. #!perl
這三種中的一種。其中第 3 種還必須得把 C:\usr\bin 加個 Path 中。
如果你不這么做,當你訪問類如 http://localhost/cgi-bin/printenv.pl(此程序以#!/usr/bin/perl開頭時) 時就會報錯(查看apache的logs):
No such file or directory: couldn't spawn child process: D:/Apache2/cgi-bin/printenv.pl
解決這個問題的方法不是修改 httpd.conf 或者注冊表什么的。你要么都用 #!C:/usr/bin/perl.exe 開頭,要么將 Apache 和 Perl 安裝到一個目錄中(都在 C: 或者都在 D:)
轉載于:https://www.cnblogs.com/dkblog/archive/2008/05/16/1980806.html
總結
以上是生活随笔為你收集整理的windows XP安装配置Perl Apache的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 文思创新深圳招聘biztalk
- 下一篇: 验证输入的是否数字的几种方法