Categories
News

XAMPP – Error: Apache shutdown unexpectedly – A fix

We ran in a problem recently at HQ where after a Windows 10 update some of our team weren’t able to connect Apache on their local development environment.

At Work, we use Xampp as our local development environment and its worked really well until now. But after a scheduled Windows 10 update some of the team starting getting the error below:

Error: Apache shutdown unexpectedly.
This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by another method.
Check the “/xampp/apache/logs/error.log” file
and the Windows Event Viewer for more clues

After a bit of hunting around and a bit of existing knowledge base in the team, we narrowed it down to another program using port 80 – Xampp’s default port for Apache.

Here are the steps we took to narrow down the problem and then find the solution.

1: Establish that it is a block on Port 80:

To start with you need to establish that this is the problem. The simplest way to do this is to change the Apache port from 80 to 7777

  • With Xampp open, click on Config
  • Select Service and Port Settings
  • You’ll then see the service settings popup which will open on the Apache tab. Change the main port from 80 to 7777 and restart Apache. If you need go to localhost:7777/you-site-name in your browser you should see your site again.

 

Apache shutdown unexpectedlyNow this got the site working for us (kinda) but we have loads of sites on our local development environment that share config files remotely that would all need to be changed to include the addition of :7777 in the local url.

So we needed to dig further.

2. Find out what else is using port 80

Now the easy fix for this is Skype which listens in on port 80 and can stop Xampp working. To disable this in Skype, use the following steps.

  • Open the Skype window
  • Click on the Tools menu and select Options.
  • Click on the Advanced tab, and go to Connection sub-tab.
  • Untick or uncheck the check box for Use port 80 and 443 as an alternatives for incoming connections option.
  • Click on Save button and then restart Skype to make the change effective.

But we don’t use Skype. So something else was stopping things from working right.

By clicking on the Netstat button in Xampp you can see a list of all the programs and applications that are listening to different ports. You can see whats listening in to port 80 and trouble shoot it. For us, port 80 was being listened into by a System app and that’s all we had to go on.

Netstat

After a bit of digging we found that there’s a few different problematic system programs that can listen in on port 80 and stop Xampp from working.  As it turned out here are a list of the top 3 common system applications that can cause a problem.

  • Web Deployment Agent Service
  • SQL Server Reporting Services (MSSQLSERVER)
  • World Wide Web Publishing Service

To stop a process like this to check if its blocking port 80

  • Go to Start
  • Search for services
  • The scroll through the list to find if one of the above is running. When you find it, click the black stop button at the top, restart Apache on Xampp and see if things work again.

XAMPP Error Fix

For us it was the World Wide Web Publishing Service. Once it was stopped we were back up and running again.

Leave a Reply

Your email address will not be published. Required fields are marked *