XAMPP Apache will not start: shutdown unexpectedly, port blocked
Error: Apache shutdown unexpectedly.Short answer
Apache cannot share a port. If something else already listens on port 80 or 443, XAMPP shows Apache shutdown unexpectedly. Find the process on the port and stop it (IIS and Skype are the usual ones), or change Listen in httpd.conf to another port such as 8080. Then read error.log if it still fails.
Fix it fast
1Find out which cause you have
Find out which program already owns port 80 and 443. Run this in an Administrator Command Prompt.
netstat -ano | findstr ":80 :443" tasklist /FI "PID eq <PID from the last column>"2Match what you see, then jump to its fix
- 1
The process on port 80 is System (PID 4) or w3wp/inetinfo.IIS or the World Wide Web Publishing Service holds port 80Fix - 2
tasklist names Skype or another client application for the PID on port 80.Skype or another program uses port 80Fix - 3
You cannot or do not want to stop the program on port 80.Keep the other program and move Apache to another portFix - 4
Nothing listens on 80 or 443, and Apache still stops at once.The port is free but the configuration is brokenFix - 5
(48)Address already in use: make_sock: could not bind to address [::]:80Overlapping Listen lines, or an old httpd still runningFix
- 1
What does the error look like?
Error: Apache shutdown unexpectedly.make_sock: could not bind to address
Cause 1 of 5
IIS or the World Wide Web Publishing Service holds port 80
1Check
Windows 10 can start Microsoft IIS on port 80 by default. Open Services and look at World Wide Web Publishing Service.
services.msc2Fix
In Services, select World Wide Web Publishing Service, click Stop, set its startup type to Disabled (as the XAMPP FAQ describes), then start Apache again.
services.msc3Verify
Start Apache from the XAMPP Control Panel; it turns green.
netstat -ano | findstr ":80"Confirmed by apachefriends.org
Cause 2 of 5
Skype or another program uses port 80
1Check
Some client applications, Skype among them, take port 80. Only one server can use a port.
tasklist /FI "PID eq 1234"2Fix
Close the program, or in Skype turn off the option that uses ports 80 and 443 as alternatives, then restart it.
taskkill /PID 1234 /F3Verify
Start Apache again.
netstat -ano | findstr ":80"Confirmed by httpd.apache.org
Cause 3 of 5
Keep the other program and move Apache to another port
1Check
Open Config > httpd.conf in the Control Panel and read the Listen line (default 80).
findstr /B /C:"Listen" C:\xampp\apache\conf\httpd.conf2Fix
Change Listen to a free port and add that port to every URL you open.
Listen 80803Verify
Start Apache and browse to the new port.
curl -I http://localhost:8080/Confirmed by httpd.apache.org
Cause 4 of 5
The port is free but the configuration is broken
1Check
The Windows service wrapper hides the real message. Run the server in a console, test the config, then read logs/error.log.
cd C:\xampp\apache\bin
httpd.exe -t
httpd.exe2Fix
Fix what the console or error.log names (a bad directive, a wrong path, a duplicate Listen line), then start Apache again.
type C:\xampp\apache\logs\error.log3Verify
httpd.exe -t reports Syntax OK, and Apache stays green.
httpd.exe -tConfirmed by httpd.apache.org
Cause 5 of 5
Overlapping Listen lines, or an old httpd still running
1Check
Search httpd.conf and the extra config files for several Listen lines for the same port, and list running httpd processes.
findstr /S /B /C:"Listen" C:\xampp\apache\conf\*.conf
tasklist | findstr httpd2Fix
Keep one Listen line per port, end the stray httpd.exe, and stop and start the server fully (a restart keeps the old ports bound).
taskkill /IM httpd.exe /F3Verify
Start Apache from the Control Panel.
netstat -ano | findstr ":80"Confirmed by httpd.apache.org
How do I stop it coming back?
- Keep IIS and the World Wide Web Publishing Service disabled on a development machine that runs XAMPP.
- Choose a non-standard port (8080) for XAMPP from the start if other tools need port 80.
- Run httpd.exe -t after every edit of httpd.conf.
- Check logs/error.log first; the Control Panel message is generic.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Related fixes
Databases
XAMPP MySQL stops right after you start it
Error: MySQL shutdown unexpectedly.
The XAMPP message is generic.
3 causes, each with a fixBack end
Airflow SSHOperator stops a long script with SSH command timed out
airflow.exceptions.AirflowException: SSH command timed out
SSHOperator waits only 10 seconds for a command by default.
3 causes, each with a fixBack end
Android gets HTML instead of JSON from a PHP API
org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
The response body is not JSON.
2 causes, each with a fixBack end
ng serve says it cannot determine the project or target
Cannot determine project for command.
The Angular CLI looked through angular.json for a project that defines the target you asked for (serve, build, test) and found none, or found several and could not pick one.
3 causes, each with a fixBack end
ng fails with Cannot find module @angular/cli/bin/ng
Cannot find module '@angular/cli/bin/ng'
The ng command is the entry point to the Angular CLI package.
2 causes, each with a fixBack end
Angular app shows 'Cannot GET /' when served by a Node.js server
Cannot GET /dashboard
Cannot GET / is Express saying no route or file matches the request.
3 causes, each with a fix