Skip to content

Public beta — free forever, no account required Download now →

Guide

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.

  1. 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 (in C:\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 :443 means the HTTPS port is the taken one. Apache needs both, so check both.

  2. Step 2: Find the process on the port

    Click Netstat in the Control Panel, or run the commands below. OwningProcess is the PID; Get-Process turns it into a program name. In Command Prompt, netstat -ano | findstr LISTENING shows the same with the PID in the last column, and tasklist /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 above
  3. Step 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 servicestate lists 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= demand
  4. Step 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.

  5. 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: change Listen 80 to Listen 8080 and ServerName localhost:80 to ServerName localhost:8080. In httpd-ssl.conf (same menu) change Listen 443, <VirtualHost _default_:443> and the ServerName line 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:8080
  6. Step 6: Start Apache and test the config

    Click Start next to Apache. If it still stops, test the configuration. Syntax OK means the files are fine and the reason is in error.log; anything else names the file and line to fix.

    Command Prompt
    C:\xampp\apache\bin\httpd.exe -t
  7. Step 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 terminal
    irm https://envkit.net/install.ps1?c=guide-xampp-apache-port-80-in-use | iex
  8. Step 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 in httpd.conf or a missing certificate file in httpd-ssl.conf also stops Apache, and httpd.exe -t names 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 siteurl and home in the wp_options table (or WP_HOME and WP_SITEURL in wp-config.php) to the address with :8080.