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
- Changing the default XAMPP Apache port
- Disabling the World Wide Publishing Service (W3PS)
- Re-installing XAMPP
- Troubleshooting using XAMPP logs
- Getting output from
apache_start.bat
- Reading Apache logs
- Getting output from
- Conclusion
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
httpd.conf
. - In the file, search for
Listen 80
and change it toListen 8080
. - Once done, try starting Apache on XAMPP again. If the problem was due to a blocked port, Apache should now start with no problem.
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):
- 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.msc
and 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 apache_start.bat
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.
4. 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.
Здравствуйте. Выполнил настройку XAMPP. Apache не хочет запускаться не в какую. Стоит WINDOWS 10
Настройку делал по этому видео = «https://www.youtube.com/watch?v=J-dZcM98NH8»
Выдает ошибку:
01:38:33 [Apache] Error: Apache shutdown unexpectedly.
01:38:33 [Apache] This may be due to a blocked port, missing dependencies,
01:38:33 [Apache] improper privileges, a crash, or a shutdown by another method.
01:38:33 [Apache] Press the Logs button to view error logs and check
01:38:33 [Apache] the Windows Event Viewer for more clues
01:38:33 [Apache] If you need more help, copy and post this
01:38:33 [Apache] entire log window on the forums
Перепробовал многое, а именно:
#Listen 12.34.56.78:80
Listen 80
поменял на
#Listen 0.0.0.0:80
#Listen [::]80
Удалил Скайп, создавал исключение в брэдмаузере на порты 80 и 443
Читал статью и пробовал это:
Видимо встроенная http служба запускается вместе с ядром системы. Попробуйте следующее:
1) Идем в реестр. Выполнить->regedit
2) В ветку HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
И отличие в этих способах:
3) Создаем параметр типа Dword c именем «NoRun» и присваиваем ему значение «1» без кавычек.
или
3) Ищем параметр «Start» и меняем значение на «0» без кавычек естественно.
4) Перезагружаем компьютер.
Пробовал и так и так.
Вот внесенные изменения в c:\xampp\apache\conf\extra\httpd-vhosts.conf
Может здесь что не так???
ServerAdmin webmaster@wordpress.ru
DocumentRoot «c:\mysites\wordpress.ru\www»
ServerName wordpress.ru
ServerAlias www.wordpress.ru
ErrorLog «c:\mysites\wordpress.ru\logs»
CustomLog «c:\mysites\wordpress.ru\logs\access.log» combinet
Require all granted
AllowOverride All
Order allow,deny
Allow from all
Помогите запустить Apache никак не хочет.
I’ve just upgraded to windows 10 and found that XAMPP/WAMP Apache won’t start anymore for some reasons. It will simply attempt to start but then fail and ask the user to check the Apache error logs.
The “culprit” or should I say, reason, is because windows 10 comes with a service known as World Wide Web Publishing Service (I will just call it WWWPS for short) which is started automatically when windows starts and uses port 80 by default. Port 80 is what Apache in XAMPP/WAMP uses by default as well, and hence why the error above since port 80 has already been taken by WWWPS.
So the solution is pretty simple:
1. Run Command Prompt and type services.msc, then click OK.
2. Scroll To World Wide Web Publishing Service. Note that the Status should say that it is Running.
3. Double Click on that row. Change the Startup type from Automatic to Manual. Next, click on Stop to stop the WWWPS service. Don’t worry, unless you’re running some software that depends on the Microsoft IIS Web Server, you should be fine.
4. Now, try to start Apache again.
Yup, that’s all and it should work. Please leave a comment if this helps or you have other suggestions.
The XAMPP installation is a very easy task, but Windows 10 sometimes might not allow the Apache server to run. So let me explain how to fix apache not starting on XAMPP.
Usually, it’s because the World Wide Publishing Service is running on port 80 on your computer, which also happens to be the default TCP/IP port that Apaches uses on XAMPP, and two applications can’t use an equivalent networking port.
If you run into this issue, there are a few ways to get around it. you’ll uninstall the publishing service, otherwise, you can change the default port on Apache.
Uninstall World Wide Web Services
Before uninstalling World Web Services make sure, you don’t have any app depending on the World Wide Web Services feature.
you can uninstall it using the following steps:
Step1: Type Control Panel in the search bar and open it.
Step2 : Click on Programs = > Programs and Features.
Step3: After that, you can see a new Window where the Left side Turns Windows features on or off option click on it.
Let See: What are the New Features in Joomla 4?
Step4: You can see a new window where an Internet Information Services option with a plus sign(+).
Step5: Click on + sign and you will see the World Wide Web Services option with a checked checkbox so clear it and click on the OK button.
Step 6: Restart your computer.
Step 7: Start XAMPP Control Panel.
Step 8: Start the Apache server by Clicking on Start Button.
Let’s See: Top 10 Free Source Code Editors For Developers
How to Change the default Apache TCP/IP port?
if you have an application that depends on World Wide Web Services and you can remove the WWWS service then you need to change TCP/IP Port. So Apache will run on different Ports.
So follow the below steps to change Apache port-
Step 1: Open XAMPP Control Panel and click the Config button.
Step 2: Select the Apache (httpd.conf) option Scroll down and find the line: Listen 80.
Step 3: Change the number 80 for another IP port number that isn’t in use. For instance, you can try port 81 or any other. (After the change the line should read: Listen 81.)
Step 4: Save and Close httpd.conf file.
Step 5: Click the Start button on Apache from the XAMPP Control Panel.
After completing the steps, the Apache server should run without issues on the new port that you specified.
How to install XAMPP on Windows 10? and How to configure it?
How to increase phpMyAdmin upload size on XAMPP?
Another common problem with XAMPP is the default database upload limit. As an example, repeatedly developers will make a replica of an internet site for troubleshooting purposes or work on-site without disrupting the live website. However, people using WordPress or another content management software will quickly determine that they can’t upload a database because it exceeds the maximum upload size permitted, which by default is 2MB.
To increase the database upload limit on phpMyAdmin, use these steps:
Step1: Open the php.ini file from the path C:\xampp\php/php.ini
Step 2: In this file search 2 variables upload_max_filesize and post_max_size. And replace old values with the required values that you want. for example post_max_size=80M and upload_max_filesize=80M to import database files of up to 40MB.
Step 3: Click on the STOP button and then, click on the START button for MySQL and Apache.
After that you complete the steps, you should now be able to import large database files on phpMyAdmin.
Let’s See: How to install XAMPP on Windows 10? and How to configure it?
How to change phpMyAdmin password on XAMPP
By default, MySQL phpMyAdmin uses “root” as username without password, which means that if you’re installing a Joomla or WordPress site when asked you only need to enter root as the username and leave the password field empty.
To change or create the phpMyAdmin password on XAMPP, use the following steps:
Step 1: After Starting XAMPP Control Panel, Open phpMyAdmin by clicking on the Admin button or directly with the path localhost/phpMyAdmin in the browser.
Step 2: Click on the User Accounts tab.
Step 3: Click the Edit privileges link for the username root, where the hostname is localhost.
Step 4: Click the tab Change password that is in the center.
Step 5: Enter Password and Confirm Password in the text fields and click on Go Button.
How to fix phpMyAdmin access denied message
Sometimes we have problems signing into phpMyAdmin, we’ll need to configure the config.inc.php.
To change the configuration settings in the config.inc.php file, follow the following steps:
Let’s See: Top 10 Free Source Code Editors For Developers
Step 1: Open XAMPP Control Panel.
Step 2: Click on Explorer Button and phpMyAdmin folder.
Step 3: In this folder, you can see the config.inc.php file. Open with any text editor.
Step4: Search “Authentication type and info,” and under this text update the following lines:
- On
$cfg['Servers'][$i]['auth_type'] = 'config';
replaceconfig
forcookie
. - On
$cfg['Servers'][$i]['AllowNoPassword'] = true;
replacetrue
forfalse
.
Step 5: Save and Close the file.
After completing the above steps you should be able to access to phpMyAdmin dashboard.
Let’s See: What is Joomla? and What is Joomla Architecture?
I tried to use the XAMPP server for my college projects, when I tried to start Apache from the XAMPP control panel in my Windows 10, I started getting “Apache shutdown unexpectedly” error message. Tried to fix it from several methods, unfortunately, failed. At last, I got one solution to fix this issue. This simple fix will surely help you to fix Apache shutdown unexpectedly easily. Error: Apache shutdown unexpectedly is mostly caused due to blocked port in XAMPP server. So in this post, we are going to explain how to fix Apache shutdown unexpectedly error easily.
If you are getting the below error when you click on the start button of the Apache in XAMPP, then this article will surely help you to come out with this problem. So try the mentioned method to fix it.
[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
- Open XAMPP control panel and click on “Config” of the Apache
- Now select the “httpd:conf”
- You have to edit some texts here, firstly search for “Listen 80” using CTRL + F
- Now change it to Listen 8080
- Now look for “ServerName localhost:80”
- Change it to “ServerName localhost:8080”
- Now save edited texts using CTRL + S or click on File -> Save
- After saving it, close the notepad
- Now click on “Config” again and select “http-ssl.conf”
- Find for “Listen 443” and change it to “Listen 4433”
- Then again find “VirtualHost_default_:443” and change it to “VirtualHost_default_:4433”
- At last, save it and close the windows
- Again go to XAMPP control panel and click on main “Config”
- Select Service and Port settings
- Now you have to change port 80 to 8080 and 443 to 4433 and save
- You are done. Restart the XAMPP control center
- Now start the Apache to check localhost working or not!
- Also Read:- How to Fix ‘Please install Skype from the Windows Store for the best experience’ Error?
How to Fix Xampp Apache Not Starting in Windows 10?
- Press Windows + R and type services.msc and hit enter
- Scroll down and search for World Wide Web Publishing Service
- Right-click on World Wide Web Publishing Service
- Now select Startup type and disable
- Also Read: – 8 Easy Ways To Speed Up Your Windows
Fix a Blocked Port in XAMPP
You can also fix the error: Apache shutdown unexpectedly messages by closing the applications which use the port 80. Some apps which use port 80 are Skype, IIS, etc. To close them to allow port 80 for your XAMPP by following the below method.
Fix Skype XAMPP Port Problem
- Open Skype and go to tools
- Click on options -> Advance -> Connection
- Now untick the checkbox “use port 80 and 443 for additional incoming connections”
- That’s it. You are done!
Bottom Line
So, guys, these are the best and working methods available to fix Apache shutdown unexpectedly error in XAMPP. I hope this method helps you to fix the Apache shutdown unexpectedly error in XAMPP. This method will 100% work to fix XAMPP localhost problem in your Windows. Do share this post with your friend who is also facing the same problem and keep visiting us.
Freelancer and writer who keeps a close eye on new technologies. He writes about the best apps/games, how-to tips, tutorials especially on Android, iPhone, computers, Windows, Linux, and Mac.