问题1:
启动不了Apache,没有安装服务。
解决:到cmd命令行:敲入
e:
cd E:\php\soft\Apache2.2\bin
httpd.exe -k install
httpd.exe -k start
问题2:
启动服务是报错: Windows 不能在 本地计算机启动 Apache2.2。有关更多信息,查阅系统事件日志
the requested operation has failed
Cannot load E:/php5apache2_2.dll into server
起初以为是8080端口被占用
先用命令行,查找占用端口的进程号PID
netstat -an -p tcp -o
结果没有找到对应的进程
后来就进入E:\php\soft\Apache2.2\conf\httpd.conf,修改段括号为8081
Listen 8081
但是还是不行。
今天早上又一次配置了PHP环境,几乎每次配置都会遇到问题,下面就是解决方法:
打开:E:\php\soft\Apache2.2\conf\httpd.conf
光标跳到最下面内容为:
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL PHPIniDir "" LoadModule php5_module "php5apache2_2.dll" #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
E:\php\soft\Apache2.2\bin>httpd.exe -k start
httpd.exe: Syntax error on line 495 of E:/php/soft/Apache2.2/conf/httpd.conf:Cannot load E:/php5apache2_2.dll into server:\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3
若修改为:
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "E:/php/soft/PHP"
LoadModule php5_module "/php5apache2_2.dll"
AddType application/x-httpd-php .php
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
E:\php\soft\Apache2.2\bin>httpd.exe -k start httpd.exe: Syntax error on line 495 of E:/php/soft/Apache2.2/conf/httpd.conf: Cannot load E:/php/soft/Apache2.2/php5apache2_2.dll into server:
\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3
一看才知道问题出在哪里,原来/php5apache2_2.dll这句,Apache以为DLL是在自己的目录下了,和高上的E:/php/soft/PHP/无关,所以要用绝对路径:
修改为:
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "E:/php/soft/PHP/"
LoadModule php5_module "E:/php/soft/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
重启
E:\php\soft\Apache2.2\bin>httpd.exe -k start httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.101 for ServerName
原文转自:http://blog.csdn.net/sonikk/article/details/7195599