windows xampp 中的 apache 无法打开 - 在它之前工作之后
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9135107/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
apache in xampp won't turn on - after it worked before
提问by Lucy Weatherford
I recently installed Xampp on my windows machine. It worked when I just did it, see here. However, now the apache won't turn on. I realize that I did not close it correctly (did not use xampp_stop), so maybe that could be the cause.
我最近在我的 Windows 机器上安装了 Xampp。当我刚刚这样做时它就起作用了,请参见此处。但是,现在 apache 不会打开。我意识到我没有正确关闭它(没有使用 xampp_stop),所以也许这可能是原因。
The error I am getting is:
我得到的错误是:
make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
unable to open logs
How can I get it to work?
我怎样才能让它工作?
采纳答案by Lucy Weatherford
I ended up solving it.
Go to the Xampp control panel. Check the "Service" check box.
Clicked on "SCM" button. (Or "Service" button, there on the "SCM" button).
Then I clicked on the "Apache" in the list of services. Turned it on.
Now it is labelled as "Running" in the control panel, and "localhost" works.
我最终解决了它。转到 Xampp 控制面板。选中“服务”复选框。单击“SCM”按钮。(或“服务”按钮,在“SCM”按钮上)。
然后我点击了服务列表中的“Apache”。打开它。
现在它在控制面板中被标记为“正在运行”,并且“本地主机”可以工作。
回答by Hightower
Just ran into this very well do documented blog with respect to Apache not working.. I think its really good to reference if you have apache startup issues.
刚遇到这个关于 Apache 不工作的非常好的文档化博客。如果你有 apache 启动问题,我认为它真的很好参考。
here are the steps that i note from the link:
这是我从链接中注意到的步骤:
- Check that xampp folder is not in a folder containing spaces or brackets ie (Program Files (x86)
- Make sure that you have run \xampp\setup_xampp.bat (probably as administrator)
- in CMD run -netstat -a (or look in Xampp control beta 3 - and press the netstat button... ) , make sure that nothing is running on port 80 ( on win 7 a lot of the time its actually skype that uses port 80) ( quit skype and try again, if so, in skype --> options ->> advanced --> make sure the "use port 80 as alternative checkbox is unchecked"
- If "system" is using port 80, then its windows that is using it ( i have read that that is some IIS service) - if you enable xampp as a service and re-boot then xampp grabs port 80 before system...
- If you dont want to run as a service then open xampp\apache\conf\http.conf and change the port that apache will run on (search for string "Listen 80" and "ServerName localhost:80" and change 80 to something else eg: "180")
- Make sure you are running Xampp control.exe as administrator
- Stop your firewall temporarily to see if its being stopped (then try startup apache again) if so, create an exception in windows firewall
- Check that your anti-virus is not stopping it.
- If you are running windows 7 64 bit ultimate (sp1) (like i am) - then you may still have a problem (like i am)
- last try is to delete xampp folder, and download a previous version of xampp, then try again.
- 检查 xampp 文件夹是否位于包含空格或括号的文件夹中,即 (Program Files (x86)
- 确保您已运行 \xampp\setup_xampp.bat(可能以管理员身份运行)
- 在 CMD 中运行 -netstat -a(或查看 Xampp control beta 3 - 然后按 netstat 按钮...),确保端口 80 上没有运行任何内容(在 win 7 上很多时候它实际上使用端口的 Skype 80)(退出Skype并重试,如果是这样,在Skype中->选项->高级->确保“使用端口80作为替代复选框未选中”
- 如果“系统”正在使用端口 80,那么它的窗口正在使用它(我已经读过这是一些 IIS 服务)-如果您将 xampp 作为服务启用并重新启动,那么 xampp 在系统之前获取端口 80...
- 如果您不想作为服务运行,则打开 xampp\apache\conf\http.conf 并更改 apache 将运行的端口(搜索字符串“Listen 80”和“ServerName localhost:80”并将 80 更改为其他内容例如:“180”)
- 确保您以管理员身份运行 Xampp control.exe
- 暂时停止您的防火墙以查看它是否被停止(然后再次尝试启动 apache)如果是这样,请在 Windows 防火墙中创建一个例外
- 检查您的防病毒软件是否没有阻止它。
- 如果您正在运行 Windows 7 64 位 Ultimate (sp1)(就像我一样)-那么您可能仍然有问题(就像我一样)
- 最后一次尝试是删除 xampp 文件夹,并下载以前版本的 xampp,然后再试一次。
If you have any other steps that you think may also cause a problem, please comment.
如果您有任何其他您认为也可能导致问题的步骤,请发表评论。
回答by Jon
I ran into this issue a couple months ago. You have to set Apache as an automatic windows service by checking the Svc checkbox in the XAMPP Control Panel. Once you have set it as a service, you will need to restart windows before you can start apache. Once you have restarted windows, you should be able to stop and start Apache through the XAMPP Control Panel.
几个月前我遇到了这个问题。您必须通过选中 XAMPP 控制面板中的 Svc 复选框将 Apache 设置为自动 Windows 服务。将其设置为服务后,您需要重新启动 Windows,然后才能启动 apache。重新启动 Windows 后,您应该能够通过 XAMPP 控制面板停止和启动 Apache。
From a blog post about it:
The reason you have to do this is because Windows 7 has a service called http.sys which starts automatically and uses port 80. Running Apache as an automatic service causes apache to start before the http.sys service. This allows apache to get port 80 before http.sys starts.
您必须这样做的原因是因为 Windows 7 有一个名为 http.sys 的服务,它会自动启动并使用端口 80。将 Apache 作为自动服务运行会导致 apache 在 http.sys 服务之前启动。这允许 apache 在 http.sys 启动之前获取端口 80。
回答by Jon
One: If it is running as a service, check your services in windows and make sure it is stopped.
一:如果它作为服务运行,请在 Windows 中检查您的服务并确保它已停止。
Two: If it is not a service, it will just be a process; go into the task manager and find httpd / apache and terminate the process.
二:如果不是服务,那只是一个过程;进入任务管理器并找到 httpd / apache 并终止该进程。
Three: Make sure you are running xampp_start / xampp_control as administrator, on some systems this is important.
三:确保您以管理员身份运行 xampp_start / xampp_control,在某些系统上这很重要。
I would recommend always using xampp_control as it gives a quick window into whether Apache is supposedly running or not even if some unusual events recently occurred.
我建议始终使用 xampp_control,因为即使最近发生了一些异常事件,它也可以快速了解 Apache 是否正在运行。
Try
尝试
netstat -aon | more
If this doesn't work, to see if anything else is listening on that port, and terminate that process.
如果这不起作用,请查看是否还有其他内容正在侦听该端口,并终止该进程。
You may also wish to edit Apache's httpd.conf (probably in xamppdir/apache/conf) to listen to another port and see if it will launch.
您可能还希望编辑 Apache 的 httpd.conf(可能在 xamppdir/apache/conf 中)以侦听另一个端口并查看它是否会启动。
回答by Mohsina
Steps:
脚步:
change the httpd.cong file in those lines:
Listen 8080
ServerName localhost:8080 ( port as example, 8080)
Now, create a xampp.ini file where the xampp-control.exe located and put the code into it:
[PORTS]
apache = 8080
Now restart the xampp.
更改这些行中的 httpd.cong 文件:
Listen 8080
ServerName localhost:8080 ( port as example, 8080)
现在,在 xampp-control.exe 所在的位置创建一个 xampp.ini 文件并将代码放入其中:
[PORTS]
apache = 8080
现在重新启动 xampp。
Hope, it will work to change the apache port. But if you have installed oracle 10g client or any software in which perl is installed then do some more steps like bellow:
希望它可以改变 apache 端口。但是,如果您已经安装了 oracle 10g 客户端或任何安装了 perl 的软件,那么请执行更多步骤,如下所示:
4.change the lines from:
4.更改行:
`# Perl settings`
`Include "conf/extra/httpd-perl.conf"`
to
到
`# Perl settings`
`#Include "conf/extra/httpd-perl.conf"`
Now restart the xampp and it works properly in 8080 port.
现在重新启动 xampp,它可以在 8080 端口正常工作。
回答by niaz
I found the problem in TeamViewer application - it uses port 80 by default. Under advanced setting I made changes so the application will not use port 80 or 443 for incoming connections. Then switched of xammp and ran again. It works!
我在 TeamViewer 应用程序中发现了问题 - 默认情况下它使用端口 80。在高级设置下,我进行了更改,因此应用程序不会将端口 80 或 443 用于传入连接。然后切换 xampp 并再次运行。有用!
回答by Ubermonk
I had a similar problem, and after a bit of research, found out that the culprit in my case was the "World Wide Web Publishing Service"(W3SVCin the iissvcsGroup).
我有一个类似的问题,以及一些调查后,发现原来在我的案件的罪魁祸首是“万维网发布服务”(W3SVC在iissvcs集团)。
Apache in XAMPP ran without a problem after stopping this servicein my case.
在我的情况下,停止此服务后,XAMPP 中的 Apache 运行没有问题。
Hope this helps
希望这可以帮助
回答by RW4
If your issue hasnt been solved, scan this page for the "windows auto fix" link. It worked for me: Ran the tool, restarted PC, all ports open, instantly on.
如果您的问题尚未解决,请扫描此页面以查找“Windows 自动修复”链接。它对我有用:运行工具,重新启动 PC,打开所有端口,立即打开。
http://support.microsoft.com/kb/811259/en
http://support.microsoft.com/kb/811259/en
GL
GL
回答by JsusSalv
This might help others that's why I am posting my particular solution. I recently swapped Zend Server CE for XAMPP (2.5). The VHOSTS file had to be set-up with an Include directive to an error_log. I was having issues with SVN so I wiped the project I am working on to get a fresh install. However, I happened to start XAMPP prior to doing an svn checkout. That's when I noticed apache doing the Busy...Apache started [Port 80] business. Someone's comment on this thread reminded me of the Include directive. I climbed through the directories and added a blank error_log and blammo! Apache started up nicely.
这可能会帮助其他人,这就是我发布我的特定解决方案的原因。我最近将 Zend Server CE 换成了 XAMPP (2.5)。VHOSTS 文件必须使用包含指令设置到 error_log。我在使用 SVN 时遇到了问题,所以我擦除了我正在处理的项目以进行全新安装。但是,我碰巧在进行 svn checkout 之前启动了 XAMPP。就在那时,我注意到 apache 正在忙着……Apache 开始了 [端口 80] 业务。有人对此线程的评论让我想起了 Include 指令。我爬过目录并添加了一个空白的 error_log 和 blammo!Apache 启动得很好。
This might help someone else too :)
这也可能对其他人有帮助:)
回答by WendiT
In my case I solved it by opening xampp\apache\conf\http.conf.
就我而言,我通过打开 xampp\apache\conf\http.conf 解决了它。
I changed Listen 80 to Listen 2337 Above that line I had to add Listen 127.0.0.1:80
我将 Listen 80 更改为 Listen 2337 在该行上方我必须添加 Listen 127.0.0.1:80
Then I opened xampp\apache\conf\httpd-ssl.conf
然后我打开xampp\apache\conf\httpd-ssl.conf
I changed Listen 80 to Listen 7332
我把听 80 改为听 7332
Then I could connect to localhost again.
然后我可以再次连接到本地主机。