XAMPP Apache won’t start: port 80 or 443 in use
“Problem detected! Port 80 in use by "Unable to open process" with PID 4! Apache WILL NOT start without the configured ports free!” Apache only starts when nothing else listens on ports 80 and 443. On Windows the usual holders are IIS or another Windows service behind the System process, an older Skype, VMware’s shared-VM service, or a second local stack. Here is how to find which one it is, free the port or move Apache, and what to check when it still stops.
- Platform
- Windows 10/11 with XAMPP in C:\xampp
- Time
- About 10 minutes
- You need
- XAMPP installed in C:\xampp (adjust the paths if yours is elsewhere)
- A Command Prompt or PowerShell run as administrator, to list and stop services
XAMPP paths are for the default C:\xampp install; EnvKit details checked against 0.33.0-beta.56 on 2026-10-29.
Step 1: Read what Apache reports
The XAMPP Control Panel prints a “Problem detected!” line with the port and the PID (process ID) of whatever holds it. If it only says “Apache shutdown unexpectedly”, click Logs next to Apache and open
error.log(inC:\xampp\apache\logs). A port conflict looks like(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address [::]:80.The same line with
:443means the HTTPS port is the taken one. Apache needs both, so check both.Step 2: Find the process on the port
Click Netstat in the Control Panel, or run the commands below.
OwningProcessis the PID;Get-Processturns it into a program name. In Command Prompt,netstat -ano | findstr LISTENINGshows the same with the PID in the last column, andtasklist /FI "PID eq 1234"names it.PowerShell Get-NetTCPConnection -LocalPort 80,443 -State Listen -ErrorAction SilentlyContinue | Select-Object LocalAddress, LocalPort, OwningProcess Get-Process -Id 1234 # the OwningProcess number from aboveStep 3: PID 4 (System): a Windows service using HTTP.sys
PID 4 is Windows itself. It holds the port for a service that uses HTTP.sys, the web listener built into Windows, so there is no program window to close. In an administrator prompt,
netsh http show servicestatelists the registered URLs and the process behind each one.The usual services are IIS (World Wide Web Publishing Service,
W3SVC), Web Deployment Agent Service (MsDepSvc), SQL Server Reporting Services and BranchCache. Stop the one you do not need and set it to Manual so it does not come back after a restart. If you never use IIS, removing it under Turn Windows features on or off also works.Command Prompt (administrator) netsh http show servicestate net stop W3SVC sc config W3SVC start= demandStep 4: A named program: Skype, VMware or another stack
Older Skype desktop versions used ports 80 and 443 as a fallback. In those versions, untick “Use port 80 and 443 for additional incoming connections” under Tools → Options → Advanced → Connection.
On VMware Workstation versions that still have shared VMs, the VMware Workstation Server service listens on 443. Turn sharing off under Edit → Preferences → Shared VMs, or set that service to Manual.
Another local stack is the other common case: WampServer, Laragon, a second Apache or nginx, or Docker Desktop publishing a container on port 80. Stop it before starting XAMPP, since two web servers cannot listen on the same port.
Step 5: Or move Apache to other ports
If the other program has to keep running, give Apache different ports. Click Config next to Apache and open
httpd.conf: changeListen 80toListen 8080andServerName localhost:80toServerName localhost:8080. Inhttpd-ssl.conf(same menu) changeListen 443,<VirtualHost _default_:443>and theServerNameline to 4433.Then click Config at the top right of the Control Panel, open Service and Port Settings, and enter the same numbers on the Apache tab so the panel checks the right ports. Your sites are now at http://localhost:8080.
C:\xampp\apache\conf\httpd.conf Listen 8080 ServerName localhost:8080Step 6: Start Apache and test the config
Click Start next to Apache. If it still stops, test the configuration.
Syntax OKmeans the files are fine and the reason is inerror.log; anything else names the file and line to fix.Command Prompt C:\xampp\apache\bin\httpd.exe -tStep 7: Or run your projects in EnvKit
EnvKit is a free app that runs nginx or Apache, PHP, MySQL or MariaDB and phpMyAdmin, and serves each project at https://<folder>.test with a trusted certificate. It needs ports 80 and 443 too, so stop XAMPP’s Apache and MySQL before you install it.
Or install from the terminalirm https://envkit.net/install.ps1?c=guide-xampp-apache-port-80-in-use | iexStep 8: What EnvKit does when a port is taken
EnvKit does not start its web server on a port another program holds. The error names the program and its PID; for PID 4 it says that HTTP.sys is behind it and points at
netsh http show servicestate. In the first-run setup the same case reads “Another program is using port 80 or 443”.On the web server’s page in Services, Diagnose & repair names the process holding the port and, after you confirm, stops it and starts the web server again. To keep the other program instead, change the web server’s ports under Settings → Ports.
If something goes wrong
- Port 80 is free, but Apache still stops
- Check port 443 as well, then read
error.log. A typo inhttpd.confor a missing certificate file inhttpd-ssl.confalso stops Apache, andhttpd.exe -tnames the file and line. - The port is taken again after every restart
- The service holding it starts automatically. Set it to Manual or Disabled in services.msc (or with
sc config <name> start= demand) instead of stopping it every time. - Links break after moving Apache to 8080
- Apps that store their own address keep the old one. For WordPress, set
siteurlandhomein thewp_optionstable (orWP_HOMEandWP_SITEURLinwp-config.php) to the address with:8080.