XAMPP下,Apache启动时报Can't load Perl file问题的解决
问题现象:
通过xampp面板启动apache时,面板总提示:
“Busy。。。
Apache service started
”
但始终未能真正起来。
?
找到apache错误日志:D:\xampp\apache\logs\error.log,里面的错误信息如下:
[Mon Apr 09 15:00:26 2012] [error] Attempt to reload DynaLoader.pm aborted.\nCompilation failed in require at D:/xampp/perl/site/lib/ModPerl/Const.pm line 18.\nBEGIN failed--compilation aborted at D:/xampp/perl/site/lib/ModPerl/Const.pm line 18.\nCompilation failed in require at D:/xampp/perl/site/lib/Apache2/Const.pm line 18.\nBEGIN failed--compilation aborted at D:/xampp/perl/site/lib/Apache2/Const.pm line 18.\nCompilation failed in require at D:/xampp/apache/conf/extra/startup.pl line 9.\nBEGIN failed--compilation aborted at D:/xampp/apache/conf/extra/startup.pl line 9.\nCompilation failed in require at (eval 2) line 1.\n
[Mon Apr 09 15:00:26 2012] [error] Can't load Perl file: D:/xampp/apache/conf/extra/startup.pl for server localhost:80, exiting...
?
网上查阅资料说是因为和oracle的某个环境变量冲突所致(我的机器上安装有Oracle10g)。
?
解决办法:
?
找到文件:D:\xampp\apache\conf\extra\httpd-perl.conf,添加“PerlSwitches -T”,红色字体部分:
LoadFile "D:/xampp/perl/bin/perl510.dll"
LoadModule perl_module modules/mod_perl.so
PerlSwitches -T
PerlPostConfigRequire "D:/xampp/apache/conf/extra/startup.pl"
?
再次启动Apache服务,成功启动。
?
?