PHP Apache shutdown unexpectedly启动错误解释及解决的方法

来源:互联网 发布:汉诺塔递归算法java 编辑:程序博客网 时间:2024/05/22 12:56

PHP Apache shutdown unexpectedly启动错误解释及解决的方法

时间:2017-06-11 12:58:23      阅读:51      评论:0      收藏:0      [点我收藏+]

标签:src   hosts   iis   opp   bsp   网络   amp   more   ast   

在学PHP的时候,偶然发现XAMPP窗体Apache的启动出现错误,出现下面的错误提示:

9:52:41  [Apache] Attempting to start Apache app...

9:52:41  [Apache] Status change detected: running
9:52:42  [Apache] Status change detected: stopped
9:52:42  [Apache] Error: Apache shutdown unexpectedly.
9:52:42  [Apache] This may be due to a blocked port, missing dependencies, 
9:52:42  [Apache] improper privileges, a crash, or a shutdown by another method.
9:52:42  [Apache] Check the "/xampp/apache/logs/error.log" file

9:52:42  [Apache] and the Windows Event Viewer for more clues

技术分享
这个问题比較常见, 一般是80、443port被占用

cmd 通过执行apache/bin/httpd.exe 打印例如以下log: 
通过执行cmd ,输入命令行 netstat -a 查看全部的被占用的port;例如以下图:

技术分享
如图可知, 443的port被占用了,导致Apache 无法正常启动;

解决的方法例如以下:

(OS 10048)通常每一个套接字地址(协议/网络地址/port)仅仅同意使用一次。 : make_sock: could not bind to address 0.0.0.0:443
或者后面是80port被占用

(OS 10048)通常每一个套接字地址(协议/网络地址/port)仅仅同意使用一次。

: make_sock: could not bind to address 0.0.0.0:80 或[ : : ]:80

一、最快的处理方法就是改动port号:

1、443port被占用。apache无法监听443port,该怎样解决呢?

在/xampp/apache/conf/extra/httpd-ssl.conf

把Listen 443 改动为 444(可自己定义)


2、80port被占用,apache无法监听80port。该怎样解决呢?

在/xampp/apache/conf/extra/httpd.conf

把Listen 80 改动为 88 (可自己定义)

假设配置了vhosts的话请把httpd-vhosts.conf 中port改为88(同上port号)


二、最直接的方法是关闭占用80、443port的进程:
1. 通过cmd中netstat -ano 看看本机80、 443port被占用没 ----- --这里 可能会被其它程序占用如iis、虚拟机等
2.通过cmd中打印tasklist,查找占用80、443port的进程名称。


3.taskkill /pid port号 杀掉此进程名称。XAMPP重新启动apache就可以。

综上所述第一种方法推荐使用,另外一种每次启动都或多或少的再次遇到。



PHP Apache shutdown unexpectedly启动错误解释及解决的方法

标签:src   hosts   iis   opp   bsp   网络   amp   more   ast   

(0)
(0)
  
举报
评论 一句话评论(0
0条  
登录后才能评论!
分享档案
更多>
2017年07月05日 (1054)
2017年07月04日 (1694)
2017年07月03日 (1652)
2017年07月02日 (1490)
2017年07月01日 (1724)
2017年06月30日 (1658)
2017年06月29日 (1791)
2017年06月28日 (1500)
2017年06月27日 (1630)
2017年06月26日 (1603)
周排行
mamicode.com排行更多图片
更多
  • Vue.js学习笔记:属性绑定 v-bind  2016-10-22
  • VSOP87 系数表(JSON 格式)  2016-06-10
  • Uploadify/uploadifive上传(中文文档)  2015-03-09
  • 免费视频播放器videojs中文教程  2017-04-11
  • http请求与响应全过程  2016-05-24
  • CSS样式的优先级  2015-02-01
  • WEB扫描技术--awvs扫描器扫描web漏洞  2015-12-14
  • Webrtc服务器搭建  2015-03-12
  • css中的px、em、rem 详解  2015-05-26
  • maven依赖本地非repository中的jar包-依赖jar包放在WEB-INF/lib等目录下的情况客户端编译出错的处理  2014-08-20
阅读全文
0 0