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.
Update 6 April 2023: Added some new solutions to the article.
- The problem
- Possible causes and fixes
- Troubleshooting using XAMPP logs
1. The problem
If Apache is unable to start on your XAMPP Control Panel, you will likely see the following error shown below:
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:
- Click on the Config button next to the Apache Web server (refer to the image below), and select
- In the file, search for
Listen 80and change it to
- Once done, try starting Apache on XAMPP again. If the problem was due to a blocked port, Apache should now start with no problem.
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
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):
- Open the Control Panel.
- Select View by > Large Icons, so that all the icons in the Control Panel appear. Then, select Programs and Features.
- In the Programs and Features window, click on Turn Windows features on or off.
- In the newly-opened window, expand the Internet Information Service field, and uncheck the World Wide Web Services checkbox (see the image below).
- Once done, reboot your device, then try to start XAMPP Apache again. It should be able to run on port 80 now.
To stop the W3PS service (for this current boot) on your Windows device:
- Open the Windows Service Manager by pressing Windows ⊞ + R keys, and in the popped window, type in
services.mscand press Enter.
- Search for the World Wide Publishing Service option under the Name column and open its properties by double-clicking on it.
- In the General tab, click Startup Type and switch it to manual. Now, you are able to turn on/off W3PS manually.
- Stop the service and click OK.
- Try to start the XAMPP Apache web server again.
c. Re-installing XAMPP
If neither of the 2 fixes above worked for you, then there is likely a misconfiguration in your XAMPP installation or Apache config files. In such a case, you have 2 options:
- Read the log files to find out what happened, or;
- Re-install XAMPP (here’s the official source)
In most cases, re-installation will be the easier option. If you can uninstall it through the Add or remove programs interface, that would be best. Otherwise, if you can’t find XAMPP on Add or remove programs, you will have to find the folder where XAMPP is and manually remove the folder (it is usually found in
C:\xampp). Always uninstall through Add or remove programs (or the Control Panel) if you have the option.
If you can’t find where XAMPP is installed on your computer, you can also do a search for
xampp-control.exe on your File Explorer. The folder that contains
xampp-control.exe is where XAMPP was installed.
3. Troubleshooting using XAMPP logs
If you still have trouble starting Apache after trying the solutions above, then your issue is very specific to your machine. In such a case, you will have to consult Apache’s or XAMPP’s log files to pinpoint what the error is.
a. Getting output from
Funnily enough, the XAMPP Control Panel doesn’t actually output the messages that Apache outputs. Hence, if Apache doesn’t start, you can actually try running the
apache_start.bat file in your XAMPP install folder (for most of you, it should be in
C:\xampp\apache_start.bat). This will try to start XAMPP’s Apache using the Command Prompt, and output messages that you might otherwise not see in the Control Panel.
b. Reading Apache logs
You can also read Apache’s logs (
error.log is probably the most useful one) to see if it provides you with any insight. The logs can be accessed from XAMPP Control Panel, using the Log button beside the line for the Apache module.
These logs will not be as helpful as the output from
apache_start.bat however, as these logs are usually filled up when Apache is running; but our problem here is that it can’t even start.
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:
There are 2 comments:
Just want to document an additional issue I spotted while troubleshooting a problematic install of XAMPP today. The computer I troubleshooted had 2 copies of XAMPP installed: one through Apache Friends’ XAMPP, and another through Moodle. Because of that, the Apache Friends’ version of XAMPP was not working, as it kept loading Moodle’s XAMPP and website.
To rectify this issue, we had to delete the Moodle folder and delete our present install of Apache Friends’ XAMPP, as the Moodle install also messed up Apache’s start up after the uninstall (it was not able to load the files found in
Thanks for providing such important information and saving our precious time. Keep uploading such blogs👌