XAMPP, Apache - Error: Apache shutdown unexpectedl

2019-01-02 19:25发布

I've just re-installed XAMPP, and when I try to start my Apache server in the XAMPP Control Panel, I now get the following errors:

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

How do I solve this?

标签: apache xampp
30条回答
十年一品温如言
2楼-- · 2019-01-02 19:43

I had the same issue, and it turns out I forgot to run setup_xampp.bat (portable version).

查看更多
爱死公子算了
3楼-- · 2019-01-02 19:43

I had the same problem sometime back. I had a old laptop, on which almost all the ports were either blocked or were malfunctioning. This is how I did it.

  1. Open the XAMPP control panel.

  2. Click on Config

  3. Then, go into Apache httpd.conf file. Open it with a text editor.

  4. Search for "80" (Do Ctrl + F and find all of them. Replace it with 8080 or 4040 or 4000).

  5. Save the file. And restart XAMPP.

It worked well for me, and I hope it helps you too.

查看更多
伤终究还是伤i
4楼-- · 2019-01-02 19:44
  1. Make at first sure your \xampp folder is in the root! This is important as the path is relative.

  2. Then make sure you run the xampp_control.exe with admin rights.

  3. Then change the files below to avoid issues with blocked port 80.

In \xampp\xampp-control.ini it should be set:

[ServicePorts]
Apache=8080
ApacheSSL=4433

Find \xampp\apache\conf\httpd.conf and set:

Listen 8080

ServerName localhost:8080

Find \xampp\apache\conf\extra\httpd-ssl.conf and set:

Listen 4433

<VirtualHost _default_:4433>

ServerName www.example.com:4433

Then end all services and restart xampp-control.exe with admin rights. It should run!

查看更多
还给你的自由
5楼-- · 2019-01-02 19:45

The Apache server by default runs on ports 80, 443. Your problem is one or both of the two ports are busy. Usually Skype or VMware Workstation use these two ports. So, make sure that they're not running. The best way to make sure the ports are free on windows is :

  • Click windows button.

  • In the search bar type resmon, to open the resource monitor resmon.exe.

  • Open Listening Ports, this will show you the opened used ports.

  • Now you can see which process is using ports 80 and 443.

  • Then you can kill the process either from CMD using its PID (which is shown in the resource monitor), or directly from Task Manager.

  • To kill a process from CMD using PID type Taskkill /PID 26356 /F, where 26356 is the PID.

查看更多
临风纵饮
6楼-- · 2019-01-02 19:46

One thing you can do is to stop the services on port 80 by issuing

net stop http

in a cmd. You'll be asked if you're sure you want to stop those services. I found out that I had a few services I wasn't using and disabled them.

To see who else is using port 80 type in a cmd

netstat -abno

I'm assuming you want to run Apache on port 80. If this is the case and you want to keep the conflicting services you will need to associate them to a new port.

If the problem is not a busy port you can also try the following: select "show debug information" in the XAMPP config panel. When starting Apache you'll be shown something like "Executing "c:\xampp\apache\bin\httpd.exe". If you run that

c:\xampp\apache\bin\httpd.exe

in a cmd you will get some more information (I once for instance had some issue with my httpd.conf file).

Related: How do I free my port 80 on localhost Windows? and Apache won't run in xampp

查看更多
有味是清欢
7楼-- · 2019-01-02 19:46

This happend due to default port 80 is blocked for Apache. You need to change the port or make the port accesible.

Go to your Apache configuration (httpd.conf) file in the Apache installation.

Find these lines:

#

Listen 192.168.1.2:80

Listen 80

#

Here 192.168.1.2 is my private IP address. Change it according to yours.

Change as below

Listen 192.168.1.2:8081

Listen 8081

Now when you access localhost you have to add the port explicitily as http://localhost:8081/...

查看更多
登录 后发表回答