Apache shut down unexpectedly due to a blocked port – Solution

The Problem:

You start Apache ( XAMPP, WAMP, MAMP, AMPPPS or something ) and mysql starts just fine but Apache gives red errors along the lines of:

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

The Solution:

If you are using the latest Skype:

  1. Go to Tools > Options > Advanced > Connection
  2. Disable the “Use port 80 and 443 for alternatives for incoming connections” setting
  3. Sign Out and close all Skype windows*
  4. Start Apache and it should work now

* On Windows 8 you will need to open Task Manager and kill the skype.exe process before changes will take effect. Skype never really shuts off completely by just closing the window on Windows 8.

UPDATE (28th September 2015)

Some people have still had issues with port 80 being blocked so I’m going to list some possible causes below. Unfortunately without knowing more about someone’s individual setup and what they have installed it’s impossible for me to know what the problems is.

So, it could be:

  1. Another application (other than Skype is using port 80). Likely candidates are another server such as WAMP, MAMP, AMPPS, or Visual Studio Server (which will have been installed if you installed Visual Studio Express/Pro for Web). Even if you’ve uninstalled them they can still “reserve” the right to port 80. Best set XAMPP to use another port such as 8080, which is a common alternative to port 80.
  2. Firewalls. A firewall is designed to prevent incoming and outgoing connections. Some firewalls block port 80 by default because it’s a common port to get attacked or scanned by malicious A-holes.
  3. Anti-virus software. Again, by default some anti-virus software will block port 80.

Possible solutions:
Open up your task manager and see what applications/processes are running. If any of the above are running, either kill them in the task manager (if possible…many firewalls and anti-viruses won’t allow you to stop them from the task manager) or from the actual application and restart XAMPP (mainly Apache) and try again. Once you’ve found the culprit either change it’s configuration to allow XAMPP to have port 80…or change which port XAMPP by default. Again, 8080 is a common alternative. More on how to do that here: http://stackoverflow.com/questions/11294812/how-to-change-xampp-apache-server-port

That’s all the advice I can offer I’m afraid. Hope it helps!