- 95 Views
- 04/08/2025
Fix Apache cannot start because port 80 is already in use on XAMPP
The error in your XAMPP log says:
Apache WILL NOT start without the configured ports free!
This means Apache cannot start because port 80 is already in use by a System process (PID 4) — typically reserved for internal Windows services.
Step-by-Step Solution
Option 1: Change Apache Port to 8080 (Quick & Safe Fix)
Open XAMPP Control Panel
Click Config next to Apache → select httpd.conf
Find this line:
Listen 80Change to:
Listen 8080Scroll down to:
ServerName localhost:80Change to:
ServerName localhost:8080Save & close the file.
Restart Apache.
Now access your site using:
http://localhost:8080
Option 2: Stop the service that uses port 80 (advanced)
Open Command Prompt (Admin)
Run:netsh http show servicestateLook for:
Listen URL: http://+:80/
Registered by: <service name>If you see something like:
Registered by: Windows Remote ManagementOr
Web Deployment Agent ServiceYou can disable that service in services.msc:
Press Windows + R → type services.msc
Find the service
Right-click → Stop
Right-click again → Properties → Set to Disabled
Option 3: Use TCPView (by Microsoft) to find the exact service
Download TCPView: https://learn.microsoft.com/en-us/sysinternals/downloads/tcpview
Run the app
Sort by Local Port → find port 80
See which service/process is using it
You can right-click → "Kill Process" (if safe) or use the name to disable the service in services.msc.
Recommended: Use Port 8080 Unless You Need Port 80
Port 80 is often protected by Windows or used by services like IIS, SQL Reporting Services, etc. If you're just testing websites locally, using port 8080 is a safer and easier long-term solution.
Thanks for visit my website
