XAMPP:Apache shutdown unexpectedly

来源:互联网 发布:微博发淘宝链接被屏蔽 编辑:程序博客网 时间:2024/05/21 09:23
本错误有多重解决方案,请根据不同环境进行选择
  1. 1. XAMPP4.0,Apache
  2. 2. XAMPP,修改配置文件httpd.conf

1.XAMPP4.0,Apache

症状

11:22:10  [Apache]  Error: Apache shutdown unexpectedly.
11:22:10  [Apache]  This may be due to a blocked port, missing dependencies,
11:22:10  [Apache]  improper privileges, a crash, or a shutdown by another method.
11:22:10  [Apache]  Check the "/xampp/apache/logs/error.log" file
11:22:10  [Apache]  and the Windows Event Viewer for more clues

诊断

出现Apache shutdown unexpectedly错误的原因一般正如提示所说:端口被占用,依赖项丢失,权限不足,崩溃,或者非法关闭XAMPP.

可以通过运行apache/bin/httpd.exe 打印错误log获得错误信息。

本次异常的错误信息如下:(OS 10048)通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 : make_sock: could not bind to address 0.0.0.0:443 

也就是说443端口被占用了,apache无法监听443端口了。

 

解决

最直接的方法是关闭占用443端口的进程: 
1. netstat -ano 看看 443端口被占用没 --这里 原来被虚拟机占用了 我日
2.通过cmd中打印tasklist,查找占用443端口的进程。 
3.taskkill /pid 端口号 杀掉此进程,XAMPP重启apache即可

2.XAMPP,修改配置文件httpd.conf

症状

修改配置文件后,重启XAMPP上的Apache服务器,报错:

11:22:01  [Apache]  Error: Apache shutdown unexpectedly.
11:22:01  [Apache]  This may be due to a blocked port, missing dependencies,
11:22:01  [Apache]  improper privileges, a crash, or a shutdown by another method.
11:22:01  [Apache]  Check the "/xampp/apache/logs/error.log" file
11:22:01  [Apache]  and the Windows Event Viewer for more clues

 

修改的配置文件节点:

01<Directory "G:\Profero\project\Westernunion\wwwroot\my\web\">
02   Options Indexes FollowSymLinks Includes ExecCGI
03   AllowOverride All
04   Require all granted
05</Directory>
06 
07<VirtualHost *:8080>
08ServerName   demo.wu.my
09DocumentRoot G:\Profero\project\Westernunion\wwwroot\my\web
10</VirtualHost>

 

诊断

修改了httpd.confi才导致此问题,肯定就是配置文件改错了,格式、不正确的路径均可导致此问题

解决

参考其他的配置节点发现Directory节点目录路径后面多了一个反斜杠\,取之,重启,OK:

view source
print?
1<Directory "G:\Profero\project\Westernunion\wwwroot\my\web">
2   Options Indexes FollowSymLinks Includes ExecCGI
3   AllowOverride All
4   Require all granted
5</Directory>

 

0 0