XAMPP错误: Apache shutdown unexpectedly解决办法 & 更改Apache端口号后如何打开localhost的解决办法 by yojiaku

时间:2016-07-19 15:31:14   收藏:0   阅读:1276

---恢复内容开始---

今天,在启动XAMPP中Apache时遇到了这样的问题:

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

出现这个错误的原因是:端口被占用

技术分享

我们只需要修改Port(s)即可:

  1. 首先打开XAMPP Control Panel,找到Apache的Config文件:技术分享

    click The Config button, and select the Apache (httpd.conf).

    Inside the httpd.conf file, find this line:Listen 80 and this line:ServerName localhost:80,then change the number "80" to the any number you like,for example:"8080". Remember to save this file.

  2. Then select the Apache (httpd-ssl.conf). Inside this file, we should find three lines: 

  3. Restart the Apache service.

We can see this when we restart the Apache service:

技术分享

and this:

15:01:32  [Apache]  Problem detected!
15:01:32  [Apache]  Port 80 in use by ""C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin\httpd.exe" -k runservice" with PID 2820!
15:01:32  [Apache]  Apache WILL NOT start without the configured ports free!
15:01:32  [Apache]  You need to uninstall/disable/reconfigure the blocking application
15:01:32  [Apache]  or reconfigure Apache and the Control Panel to listen on a different port
15:01:32  [Apache]  Attempting to start Apache app...
15:01:32  [Apache]  Status change detected: running

It means we solve this problem.

Then we move to another problem: when we open the localhost, we see this:

技术分享

To solve this problem, we should change "localhost" to "localhost:8080" ("8080" is your number which you have changed)

Just like this:

技术分享

 

 

 

 

 

---恢复内容结束---

原文:http://www.cnblogs.com/yojiaku/p/5684901.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!