XAMPP Apache not starting on Windows

XAMPP Apache not starting on Windows

In a previous article, we’ve explored the issue of Apache being unable to start on macOS devices. In this article, we will be exploring the same thing, but for the Windows version of XAMPP.

What should you do if XAMPP’s Apache service does not run on your Windows machine? Read on to find out.

  1. The problem
  2. Possible causes and fixes
    1. Changing the default XAMPP Apache port
    2. Disabling the World Wide Publishing Service (W3PS)
  3. Conclusion

1. The problem

If Apache is unable to start on your XAMPP Control Panel, you will likely see the following error shown below:

XAMPP Control Panel Apache Error
The error messages shown when Apache fails to start.

When you try to start Apache Web Server, the XAMPP Control Panel will attempt to do so, but end up failing abruptly, mentioning that “Apache shutdown unexpectedly” (like the red text shown in the photo above).

Below is a transcription of the error, with the shutdown message highlighted.

[Apache] Attempting to start Apache app...
[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.

2. Possible causes and fixes

If XAMPP’s Apache cannot start, it is very likely that your default HTTP port (80), is blocked or being used by another application. To fix that, you can explore the solutions below.

a. Changing the default XAMPP Apache port

To determine if port 80 being blocked is your actual problem, you can change the default port number for Apache and see if it fixes your issue.

To change XAMPP Apache’s port number, refer to the steps below:

  1. Click on the Config button next to the Apache Web server (refer to the image below), and select httpd.conf.
  2. In the file, search for Listen 80 and change it to Listen 8080.
  3. Once done, try starting Apache on XAMPP again. If the problem was due to a blocked port, Apache should now start with no problem.
The Config button in XAMPP Apache
Where the Config button is in the XAMPP Control Panel.

Article continues after the advertisement:


Note that if you are using any other port than 80 or 443, you will have to append the port number at the end of the URL to access the page(s) on XAMPP. For example, if Apache listens to port 8080, the URL you will have to access will be localhost:8080 instead of the default localhost.

Note that for pre-existing virtual hosts on your XAMPP Apache, you will also need to update them to listen to port 8080 instead of 80.

If XAMPP still fails to start after changing your port, that means that the problem is not caused by a blocked port. In this case, you will want to undo the changes made to httpd.conf, so that Apache is back to using Port 80.

b. Disabling the World Wide Web Publishing Service (W3PS)

If you are running a Windows server machine, you may have a process running called the World Wide Web Publishing Service (W3PS). The W3PS is a component of Windows’ Internet Information Services (IIS) — which is responsible for providing HTTP and HTTPS services on Windows machines — may be using port 80, thereby not allowing XAMPP Apache to connect to the same port.

Below, you can read instructions on how to either deactivate or stop the W3PS service, so that port 80 can be freed up for Apache’s use.

To deactivate the W3PS service (so that it doesn’t automatically start on your Windows device):

  1. Open the Control Panel.
  2. Select View by > Large Icons, so that all the icons in the Control Panel appear. Then, select Programs and Features.
  3. In the Programs and Features window, click on Turn Windows features on or off.
  4. In the newly-opened window, expand the Internet Information Service field, and uncheck the World Wide Web Services checkbox (see the image below).
  5. Once done, reboot your device, then try to start XAMPP Apache again. It should be able to run on port 80 now.
Programs and Features in Control Panel
To find Programs and Features, you first need to change the View by to Large icons in the Control Panel.
Where to find World Wide Web Services
Where to find World Wide Web Services.

To stop the W3PS service (for this current boot) on your Windows device:

  1. Open the Windows Service Manager by pressing Windows + R keys, and in the popped window, type in services.msc and press Enter.
  2. Search for the World Wide Publishing Service option under the Name column and open its properties by double-clicking on it.
The World Wide Web Publishing Service on the Service Manager.
The World Wide Web Publishing Service (W3PS) on the Service Manager.
  1. In the General tab, click Startup Type and switch it to manual. Now, you are able to turn on/off W3PS manually.
  2. Stop the service and click OK.
  3. Try to start the XAMPP Apache web server again.

3. Conclusion

Having read the article and applied the described solutions, we hope you could manage to fix your problems. Of course, there can be many more problems that cause this, and many with different solutions for these problems. If you are facing one of them that is not described in the article, please leave us a comment so that we can add this to the article (and credit you). Hence, your comment will help us make this article more and more helpful to everyone.


Article continues after the advertisement:


Leave a Reply

Your email address will not be published.