天天看点

XAMPP启动报错解决办法:

报错详情如下:  

 Error: Apache shutdown unexpectedly.

9:26:27  [Apache]     This may be due to a blocked port, missing dependencies, 

9:26:27  [Apache]     improper privileges, a crash, or a shutdown by another method.

9:26:27  [Apache]     Press the Logs button to view error logs and check

9:26:27  [Apache]     the Windows Event Viewer for more clues

9:26:27  [Apache]     If you need more help, copy and post this

9:26:27  [Apache]     entire log window on the forums

百度翻译得到:端口堵塞80端口或443端口占用-----

解决办法:

第一种:

443端口被占用,apache无法监听443端口,该如何解决呢? 

找到安装目录:    C/xampp/apache/conf/extra/httpd-ssl.conf (我这里是装在C盘了)

把Listen 443 修改为 4433(可自定义)

<VirtualHost _default_:443>        (此处443也要修改掉保持一致;)

#   General setup for the virtual host

DocumentRoot "C:/xampp/htdocs"

ServerName www.example.com:4433

ServerAdmin [email protected]

ErrorLog "C:/xampp/apache/logs/error.log"

TransferLog "C:/xampp/apache/logs/access.log"

2、80端口被占用,apache无法监听80端口,该如何解决呢? 

C/xampp/apache/conf/extra/httpd.conf 

把Listen 80 修改为 8080 (可自定义)

ServerName   localhost: 80   修改掉同上更改一致(自定义即可)

如果配置了vhosts的话请把httpd-vhosts.conf 中端口改为8080(同上端口号)

第二种:运行 cmd  

通过cmd中netstat -ano 看看本机80、 443端口被占用没      

通过cmd中打印tasklist,查找占用80、443端口的进程名称

taskkill /pid 端口号 杀掉此进程名称,XAMPP重启apache即可

第三种:也是运行-cmd  根据打印结果解决办法:

cmd 通过运行apache/bin/httpd.exe 打印如下log:

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

或者后面是80端口被占用

(OS 10048)通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 : make_sock: could not bind to address 0.0.0.0:80  或[ : : ]:80 

其他特殊情况:

AH00526: Syntax error on line 66 of C:/xampp/apache/conf/extra/httpd-vhosts.conf:

Invalid command '-', perhaps misspelled or defined by a module not included in the server configuration

(翻译:

ah00526:C的第66行出现语法错误:/xampp/apache/conf/extra/httpd-vhosts.conf:无效命令“-”,

可能拼写错误或由服务器配置中未包含的模块定义。

)  在这个文件下的66行有个错误是这个符号  "  -   "   需要修改掉   找到删掉即可。

继续阅读