最近装了XAMPP,Apache一直启动不了,查看日志报如下错误:
有两种解决方法,我使用方法2解决问题:
1、重新配置好perl5lib环境变量,这种方法可能有些麻烦;
2、更简单的方法是:
找到apache\conf\extra\perl.conf文件,增加一行为:
其中PerlSwitches -T 参数-T的意思为检查perl所在路径。
[Sat Mar 31 11:23:35 2012] [error] Attempt to reload DynaLoader.pm aborted.\nCompilation failed in require at F:/php/xampp/perl/site/lib/ModPerl/Const.pm line 18.\nBEGIN failed--compilation aborted at F:/php/xampp/perl/site/lib/ModPerl/Const.pm line 18.\nCompilation failed in require at F:/php/xampp/perl/site/lib/Apache2/Const.pm line 18.\nBEGIN failed--compilation aborted at F:/php/xampp/perl/site/lib/Apache2/Const.pm line 18.\nCompilation failed in require at F:/php/xampp/apache/conf/extra/startup.pl line 9.\nBEGIN failed--compilation aborted at F:/php/xampp/apache/conf/extra/startup.pl line 9.\nCompilation failed in require at (eval 2) line 1.\n
[Sat Mar 31 11:23:35 2012] [error] Can't load Perl file: F:/php/xampp/apache/conf/extra/startup.pl for server localhost:80, exiting...
后来网上查到原因如下:
在windows上使用xampp搭建php的开发环境,后来又安装了oracle 10g。
由于oracle 10g 建立了“perl5lib”的环境变量路径,从而导致xampp启动apache的时候报错:
有两种解决方法,我使用方法2解决问题:
1、重新配置好perl5lib环境变量,这种方法可能有些麻烦;
2、更简单的方法是:
找到apache\conf\extra\perl.conf文件,增加一行为:
LoadFile "F:/php/xampp/perl/bin/perl510.dll"
LoadModule perl_module modules/mod_perl.so
# 检查perl所在路径
PerlSwitches -T
PerlPostConfigRequire "F:/php/xampp/apache/conf/extra/startup.pl"
其中PerlSwitches -T 参数-T的意思为检查perl所在路径。
在浏览器里http://localhost 出现如下界面,表示Apache启动成功。