XAMPP,Apache-错误:Apache意外关闭

本文翻译自:XAMPP, Apache - Error: Apache shutdown unexpectedly

I've just re-installed XAMPP, and when I try to start my Apache server in the XAMPP Control Panel, I now get the following errors: 我刚刚重新安装了XAMPP,当我尝试在XAMPP控制面板中启动我的Apache服务器时,现在出现以下错误:

16:50:25  [Apache]     Status change detected: running
16:50:26  [Apache]     Status change detected: stopped
16:50:26  [Apache]     Error: Apache shutdown unexpectedly.
16:50:26  [Apache]     This may be due to a blocked port, missing dependencies,
16:50:26  [Apache]     improper privileges, a crash, or a shutdown by another method.
16:50:26  [Apache]     Press the Logs button to view error logs and check
16:50:26  [Apache]     the Windows Event Viewer for more clues
16:50:26  [Apache]     If you need more help, copy and post this
16:50:26  [Apache]     entire log window on the forums

How do I solve this? 我该如何解决?


#1楼

参考:https://stackoom.com/question/1EmlN/XAMPP-Apache-错误-Apache意外关闭


#2楼

Follow these steps: 跟着这些步骤:

  1. Open your XAMPP control panel then click its "Config" 打开XAMPP控制面板,然后单击其“配置”
  2. Choose the "Apache (httpd.conf)" and find this code below and change it into this one: 选择“ Apache(httpd.conf)”并在下面找到此代码,并将其更改为以下代码:

    #Change this to Listen on specific IP addresses as shown below #将其更改为侦听特定IP地址,如下所示

    #to prevent Apache from glomming onto all bound IP addresses. #防止Apache陷入所有绑定的IP地址。

    #Listen 0.0.0.0:80 #听0.0.0.0:80

    #Listen [::]:80 #听[::]:80

    Listen 80

    # Dynamic Shared Object (DSO) Support #动态共享对象(DSO)支持

    1. Save it ( Ctrl + S ) 保存( Ctrl + S
    2. After that, go back to the XAMPP control panel and click its config again. 之后,返回XAMPP控制面板并再次单击其配置。
    3. Choose "Apache (httpd-ssl.conf)", find this code below, and change it again: 选择“ Apache(httpd-ssl.conf)”,在下面找到此代码,然后再次进行更改:

    # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two #注意:使用IPv6但不使用IPv4映射的地址的配置需要两个

    # Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443" #监听指令:“听[::]:443”和“听0.0.0.0:443”

    #

    #Listen 0.0.0.0:443 #听0.0.0.0:443

    #Listen [::]:443 #听[::]:443

    Listen 443

    1. Save it ( Ctrl + S ) 保存( Ctrl + S
    2. Then, click the "config" (note: above the netstat) and click the "service and port settings". 然后,单击“配置”(注意:netstat上方),然后单击“服务和端口设置”​​。
    3. Change "Main Port" to 8080 and "SSL Port" to 4433, then save it. 将“主端口”更改为8080,将“ SSL端口”更改为4433,然后将其保存。
    4. Finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off". 最后,转到“控制面板”->“程序和功能”->“打开或关闭Windows”。
    5. Uncheck your "Internet Information Services", and then click OK. 取消选中“ Internet信息服务”,然后单击“确定”。

Just wait for it and your computer/laptop will be automatically restart and try to open your XAMPP control panel again, and then start your Apache. 只需等待它,您的计算机/笔记本电脑将自动重启,并尝试再次打开XAMPP控制面板,然后启动Apache。


#3楼

One thing you can do is to stop the services on port 80 by issuing 您可以做的一件事是通过发出以下命令停止端口80上的服务

net stop http

in a cmd. 在一个cmd中。 You'll be asked if you're sure you want to stop those services. 系统将询问您是否确定要停止这些服务。 I found out that I had a few services I wasn't using and disabled them. 我发现我有一些我没有使用的服务并禁用了它们。

To see who else is using port 80 type in a cmd 要查看还有谁在使用端口80,请在cmd中键入

netstat -abno

I'm assuming you want to run Apache on port 80. If this is the case and you want to keep the conflicting services you will need to associate them to a new port. 我假设您想在端口80上运行Apache。如果是这种情况,并且想要保留冲突的服务,则需要将它们关联到新端口。

If the problem is not a busy port you can also try the following: select "show debug information" in the XAMPP config panel. 如果问题不是繁忙的端口,您还可以尝试以下操作:在XAMPP配置面板中选择“显示调试信息”。 When starting Apache you'll be shown something like "Executing "c:\\xampp\\apache\\bin\\httpd.exe". If you run that 启动Apache时,将显示类似“正在执行“ c:\\ xampp \\ apache \\ bin \\ httpd.exe”的信息。

c:\xampp\apache\bin\httpd.exe

in a cmd you will get some more information (I once for instance had some issue with my httpd.conf file). 在cmd中,您将获得更多信息(例如,我曾经有一个httpd.conf文件问题)。

Related: How do I free my port 80 on localhost Windows? 相关: 如何在本地主机Windows上释放端口80? and Apache won't run in xampp Apache将无法在xampp中运行


#4楼

Open Skype. 打开Skype。

Tools -> Options -> Advanced -> Connection. 工具->选项->高级->连接。

Uncheck the " Use port 80 and 443 for alternatives for incoming connections " checkbox 取消选中“ 使用端口80和443替代传入连接 ”复选框

Sign Out and Close all Skype windows. 退出并关闭所有Skype窗口。 Try restarting your Apache. 尝试重新启动Apache。


#5楼

For me, this problem began when I hosted a VPN-connection on my Windows 8 computer. 对我来说,当我在Windows 8计算机上托管VPN连接时,此问题就开始了。

Simply deleting the connection from "Control Panel\\Network and Internet\\Network Connections" solved the problem. 只需从“控制面板\\网络和Internet \\网络连接”中删除连接即可解决此问题。


#6楼

My problem was that in httpd.conf the DocumentRoot and <Directory> entries were pointing to non-existing folders. 我的问题是在httpd.conf中, DocumentRoot<Directory>条目指向不存在的文件夹。

For example, the 'original' httpd.conf had the following entries: 例如,“原始” httpd.conf具有以下条目:

DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">

If you've installed in C:\\xampp then you need to change those entries to match, ie 如果您已安装在C:\\ xampp中,则需要更改这些条目以使其匹配,即

DocumentRoot "c:/xampp/htdocs"
<Directory "c:/xampp/htdocs">
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值