XAMPP, Apache - Error: Apache shutdown unexpectedly
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?
Tools -> Options -> Advanced -> Connection.
Uncheck the "Use port 80 and 443 for alternatives for incoming connections" checkbox
Sign Out and Close all Skype windows. Try restarting your Apache.
As I am working in a corporate environment where developers faces firewall issues, none of the other answers resolved my issue.
As the port is not used by Skype, but by some other internal applications, I followed the below steps to resolve the issue:
Step 1 - From the XAMPP Control Panel, under Apache, click the Config button, and select the Apache (httpd.conf).
Inside the httpd.conf file, somehow I found a line that says:
And change the 80 into any number / port you want. In my scenario I’m using port 8080.
Still from the httpd.conf file, I found another line that says:
Change 80 to 8080.
Step 2 - From the XAMPP Control Panel, under Apache, click the Config button again, but this time select the Apache (httpd-ssl.conf). Inside the httpd-ssl.conf file, find line that says
And change the 443 into any number / port you want. I’ll using 4433 as the new port number.
Still from the httpd-ssl.conf file, find another line that says
<VirtualHost _default_:443> ServerName localhost:443
And change 443 to 4433.
<VirtualHost _default_:4433> ServerName localhost:4433
Remember to save the httpd.conf and httpd-ssl.conf files after performing some changes. Then restart the Apache service.
Read more... Read less...
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
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
in a cmd you will get some more information (I once for instance had some issue with my httpd.conf file).
In XAMPP Control Panel V3.2.1, click on "NetStat" button on top right. Make sure port 80 is not used by any other program. Then click on "Shell" Right below it. Issue this command "Type ap then TAB two times"
You will actually see the exact error why Apache failed. It will be mostly likely virtual host configuration issue or may be something else. It will display the line number on which the error is occurring. Just fix that error. Note that in RootDocument a trailing \ can be a source of error as well. Remove any trailing "\".
Follow these steps:
- Open your XAMPP control panel then click its "Config"
Choose the "Apache (httpd.conf)" and find this code below and change it into this one:
#Change this to Listen on specific IP addresses as shown below
#to prevent Apache from glomming onto all bound IP addresses.
# Dynamic Shared Object (DSO) Support
- Save it (Ctrl + S)
- After that, go back to the XAMPP control panel and click its config again.
- Choose "Apache (httpd-ssl.conf)", find this code below, and change it again:
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
# Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
- Save it (Ctrl + S)
- Then, click the "config" (note: above the netstat) and click the "service and port settings".
- Change "Main Port" to 8080 and "SSL Port" to 4433, then save it.
- Finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off".
- Uncheck your "Internet Information Services", and then click OK.
Just wait for it and your computer/laptop will be automatically restart and try to open your XAMPP control panel again, and then start your Apache.
My problem was that in httpd.conf the
<Directory> entries were pointing to non-existing folders.
For example, the 'original' httpd.conf had the following entries:
DocumentRoot "c:/Apache24/htdocs" <Directory "c:/Apache24/htdocs">
If you've installed in C:\xampp then you need to change those entries to match, i.e.
DocumentRoot "c:/xampp/htdocs" <Directory "c:/xampp/htdocs">
If you're using Windows 7 . Search for IIS in Windows search (Click the Window icon in left bottom and type in where it says 'Search program and files') .
Open IIS (Internet Information Service) .
In the right side in actions panel. Click Stop.