Apache shutdown unexpectedly解决方法

【转载】http://blog.csdn.net/luomoshusheng/article/details/44653615

问题描述

最近在搞点web,装了XAMPP,在启动apache的时候就郁闷了, 
18:22:07 [Apache] Error: Apache shutdown unexpectedly. 
18:22:07 [Apache] This may be due to a blocked port, missing dependencies, 
18:22:07 [Apache] improper privileges, a crash, or a shutdown by another method. 
18:22:07 [Apache] Press the Logs button to view error logs and check 
18:22:07 [Apache] the Windows Event Viewer for more clues 
18:22:07 [Apache] If you need more help, copy and post this 
18:22:07 [Apache] entire log window on the forums

解决办法

经过一番研究,原来是MainPort和SSLPort的问题,建议先在cmd中执行(安装路径)\xampp\apache\bin\httpd.exe,然后根据cmd中的提示,来解决。

  1. 第一种解决办法

    • cmd 通过运行\xampp\apache\bin\httpd.exe,打印如下: 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 : make_sock: could not bind to address 0.0.0.0:80 或[ : : ]:80 
      在/xampp/apache/conf/extra/httpd.conf 把Listen 80 修改为 88 (可自定义)
    • 满怀信心,再执行\xampp\apache\bin\httpd.exe,打印如下: 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 : make_sock: could not bind to address 
      0.0.0.0:443 在/xampp/apache/conf/extra/httpd-ssl.conf 把Listen 443 修改为 444(可自定义)
  2. 最直接的方法是关闭占用80、443端口的进程: 
    1.通过cmd中netstat -ano 看看本机80、443端口被占用没这里可能会被其他程序占用如iis、虚拟机等 
    2.通过cmd中打印tasklist,查找占用80、443端口的进程名称。 
    3.taskkill /pid 端口号 杀掉此进程名称,XAMPP重启apache即可。

推荐第一种办法。 
补充:还有一种情况我没遇到,参考网上说的。如果配置了vhosts的话请把httpd-vhosts.conf 中端口改为88(同上端口号)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值