多次安装 Apache 后,Xampp 中的 Apache 出现问题 [英] Trouble with Apache in Xampp after multiple Apache installs
问题描述
一段时间以来,我一直在尝试以一种有效的方式安装 php、apache 和 mySQL.在多次手动尝试并遇到障碍后,我最终只是尝试使用 Xampp.
I've been trying to install php, apache, and mySQL in a working fashion for some time now. After attempting manually several times and hitting roadblocks, I ended up just trying to use Xampp.
但是,在启动时,程序说:
However, upon startup, the program says:
2:18:39 PM [main] Running with Administrator rights - good!
2:18:39 PM [main] XAMPP Installation Directory: "c:\xampp\"
2:18:39 PM [main] Checking for prerequisites
2:18:39 PM [main] All prerequisites found
2:18:39 PM [main] Initializing Modules
2:18:39 PM [Apache] Apache Service detected with wrong path
2:18:39 PM [Apache] Change XAMPP Apache and Control Panel settings or
2:18:39 PM [Apache] Uninstall/disable the other service manually first
2:18:39 PM [Apache] Found Path: "C:\Apache24\bin\httpd.exe" -k runservice
2:18:39 PM [Apache] Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice
我遵循了此处的建议,但是
(a) 将端口 Listen 80
更改为 Listen *:80
或 Listen 81
没有效果.
(a) Changing the port Listen 80
to Listen *:80
or Listen 81
had no effect.
(b) 使用 netstat -ao
,没有以 80 结尾的本地地址.
(b) using netstat -ao
, there were no local addresses ending with 80.
我还尝试删除任何不在 xampp 文件夹中的与 apache、mysql 和 php 相关的文件,这些文件是之前安装尝试留下的.
I've also tried deleting any files related to apache, mysql, and php not in the xampp folder, which were left over from previous install attempts.
试过 xampp 1.8.2,卸载,试过 1.8.3,同样的问题.
Tried xampp 1.8.2, uninstalled, tried 1.8.3, same issue.
据我所知,在安装之前,我必须在 Xampp 之外的某处更改了一些代码,现在它在运行 apache 时执行,更改了 Xampp 想要的路径(预期路径:c:\xampp\apache\bin\httpd.exe" -k runservice
) 到现在删除的文件夹 C:\Apache24\bin
的路径.但是,我不知道这段代码可能在哪里!
For what I can guess, I must've changed some code somewhere outside Xampp before I installed it, and now it is executing when apache is run, changing the path from what Xampp wants (Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice
) to a path to the now deleted folder C:\Apache24\bin
. However, I don"t know where this code might be!
我尝试在整个 C 驱动器中搜索 C:\Apache24\bin,但搜索结果为空.
I tried searching my whole C drive for C:\Apache24\bin, but the search came up empty.
机器:Windows 7 64 位
Machine: Windows 7 64 bit
以前安装/卸载过:Apache2.2、Apache2.4、php5.5.4、MySQL,使用 MySQL Installer 5.6
Previously installed/uninstalled: Apache2.2, Apache2.4, php5.5.4, MySQL using MySQL Installer 5.6
在 windows 1.8.2 上试过 xampp
tried xampp for windows 1.8.2
xampp for windows 1.8.3 当前安装.
xampp for windows 1.8.3 currently installed.
有什么帮助吗?
推荐答案
出现此错误的原因是您之前安装过一次 Apache 并且其服务仍在运行.
The reason to get this error is because you had Apache installed once before and its service is still running.
如果您使用的是 Windows 7,请单击开始并输入服务".打开服务并查看是否列出了 Apache.如果是,请双击它以查看其属性.通过选择服务名称(例如 Apache 2.4) -> 右键单击 -> 选择复制来复制服务名称.
If you are using windows 7, click on start and type "services". Open Services and see if Apache is listed. If yes, double click on it to see its properties. Copy the service name (e.g Apache 2.4) by selecting it -> right click -> selecting Copy.
关闭服务窗口.
点击开始并输入cmd
.右键单击 cmd.exe 并选择以管理员身份运行".
Click on start and find cmd
by typing it. Right click on cmd.exe and select "Run as administrator".
当 cmd 窗口打开时,键入此命令并按 Enter:
When the cmd window has opened type this command and press Enter:
注意:您应该右键单击窗口以选择粘贴,而不是 Apache 2.4
note: instead of Apache 2.4 you should right click on the window to select paste
sc delete "Apache 2.4"
按回车后你应该得到消息:serviceDelete Success
After pressing enter you should get the message: serviceDelete Success
再次打开服务窗口(我在上面解释过),看看您是否再次安装了 Apache.
Open services windows again (I explained it above) and see if you have Apache there again or not.
这篇关于多次安装 Apache 后,Xampp 中的 Apache 出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!