整合PHP+Apache+MySQL非常郁闷,抗战到凌晨1:50分,终于胜利了。分享一下配置过程错误处理的历程,希望对后来人有所帮助。
一、文件安装
PHP下载:http://windows.php.net/downloads/qa/php-5.4.0alpha2-Win32-VC9-x86.zip
MySQL下载:http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.5/mysql-5.5.14-win32.msi
Apache下载:http://apache.etoak.com//httpd/binaries/win32/httpd-2.2.19-win32-x86-openssl-0.9.8r.msi
文件的安装过程可参考:http://tech.163.com/06/0206/11/299AMBLT0009159K.html
二、错误及解决方法
1、Apache服务无法启动,鼠标停留在右下角Apache图标时,提示“No services installed”。解决办法,参考:http://blog.chinaunix.net/space.php?uid=20681545&do=blog&id=1754015;
其它可能的原因:80端口占用,如IIS、迅雷等;软件冲突;httpd.conf配置错误;具体的原因可通过httpd.exe -w -n "Apache2" -k start命令启动(cmd->Apache安装目录->bin),而查看错误信息。
2、LoadModule takes two arguments, a module name and the name of a shared object file。php5_module的路径参数中可能存在空格,如“Program Files”,在路径的左右添加“”,如:LoadModule php5_module "D:/Program Files/php-5.4.0alpha2-Win32-VC9-x86/php5apache2_2.dll"
3、cannot load module php5apache2_2.dll。在网上查了很多资料,依然一头雾水,终于在LZY的博客上找到方法,非常感谢。我的php版本是php-5.4.0alpha2-Win32-VC9-x86,需要VC的运行环境,在网上下载个VC2008运行库就可以了。
(VC2008运行库:http://xiazai.xiazaiba.com/Soft/V/vcredist2008sp1_x86_XiaZaiBa.zip)
同时,必须注意版本问题:
Apache2.2 对应 php5apache2_2.dll
Apache2.1 对应 php5apache2.dll
Apache1 对应 php5apache.dll
4、启动Apache的时候,出现Visual Studio Just-In-Time Debugger的窗口,终止了启动,我真的无语了。终究还是配置文件的原因;弹出该窗口,主要是之前机器安了VS,但后来某些原因VS无法启动了,Apache服务启动过程中出现错误,自动调用vs的调试窗口,但是VS已经损坏,无法使用,就出现该窗口。解决办法是删除注册表中指定的项:
32位系统处理方法:
use the registry editor to delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
64位系统处理方法:
On a 64-bit operating system also delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebuggerhttp://tech.163.com/06/0206/11/299AMBLT0009159K.html
http://www.linuxidc.com/Linux/2010-05/26203.htm
http://www.iteye.com/topic/524246
http://www.longziyong.cn/post/738.html
http://blog.sina.com.cn/s/blog_674ddfca0100qk1b.html
http://wenku.baidu.com/view/f1ce7a0e7cd184254b3535dc.html
http://hi.baidu.com/ruhaole/blog/item/220cc86076b46cd38db10d02.html