The XAMPP "Port Blocked" error occurs when another application, typically Skype or IIS, occupies ports 80 (Apache) or 3306 (MySQL). To resolve this, you must either stop the conflicting service or reconfigure XAMPP to use alternative ports through its control panel settings.
Identifying the Conflicting Application
Before changing any configurations, it is crucial to identify which process is holding the port hostage. The most common culprits are Microsoft Internet Information Services (IIS), Skype, or VMware services. On Windows, you can use the Command Prompt to find the Process ID (PID) associated with the blocked port. Open a command prompt as an administrator and run the following command:
netstat -ano | findstr :80
This command lists all connections using port 80. Look for the line showing
LISTENING and note the number in the last column, which is the PID. You can then open Task Manager, go to the Details tab, and match the PID to the specific executable. If the process is
iisexpress.exe,
skype.exe, or
vmware-hostd.exe, you have found your conflict. Disabling these applications temporarily allows XAMPP to start, confirming they were the cause.
Stopping Conflicting Services
If the conflicting application is a system service like IIS, stopping it permanently frees up the port for XAMPP. For IIS, open the Control Panel, navigate to Programs and Features, and click Turn Windows features on or off. Uncheck Internet Information Services and restart your computer. This is often the cleanest solution because it removes the conflict entirely without needing to change XAMPP's default configuration.
For Skype, the issue usually arises because Skype binds to port 80 by default for incoming calls. Open Skype, go to Tools > Options > Advanced > Connection, and uncheck the option that uses ports 80 and 443 for incoming connections. Save the changes and restart Skype. This ensures that port 80 remains available for your local web server while keeping Skype functional for other communication methods.
Changing Apache Port Settings
If you cannot stop the conflicting application, you must configure Apache to listen on a different port. Open the XAMPP Control Panel and click the Config button next to Apache, then select
httpd.conf. Locate the line that reads
Listen 80 and change it to
Listen 8080. Similarly, find the
ServerName localhost:80 directive and update it to
ServerName localhost:8080.
After saving the file, you must also update the virtual host configuration. Open the
httpd-vhosts.conf file from the same Config menu. Change the
<VirtualHost *:80> block to
<VirtualHost *:8080>. Once these changes are saved, restart the Apache module in the XAMPP Control Panel. You can now access your local site by navigating to
http://localhost:8080 in your browser.
Configuring MySQL Port Alternatives
The MySQL port conflict is less common but equally disruptive. If port 3306 is blocked, locate the
my.ini file in the XAMPP installation directory under the MySQL folder. Find the
port=3306 setting and change it to
port=3307. Save the file and restart the MySQL service from the XAMPP Control Panel.
Note that some PHP frameworks or database connectors may require manual updates to their connection strings to reflect the new port number. Always test your database connectivity after making this change to ensure your applications can still communicate with the database engine.
Verifying the Fix
After applying the necessary changes, verify that the ports are no longer blocked. Run the
netstat -ano | findstr :80 command again. If the output only shows connections from your own machine or is empty, the port is free. Start Apache and MySQL in the XAMPP Control Panel. If both modules turn green, the troubleshooting was successful.
For more complex Windows installation errors, such as those involving MSI files, see our guide on
Error 1711: Dealing with Empty MSI Files in Windows Installer. Additionally, if you encounter broader network connectivity issues during setup, refer to
Windows 10 Offline Upgrade Stuck at 21% with Error 0xC1900101-0x2000D.
Frequently Asked Questions
Why does Skype block port 80?
Skype historically used port 80 to facilitate direct peer-to-peer connections for voice and video calls. While newer versions allow you to disable this feature, older installations may still bind to the port by default, preventing web servers from starting.
Can I run multiple websites on different ports?
Yes, you can configure Apache to listen on multiple ports like 8080, 8081, and so on. Each virtual host must be explicitly defined in the
httpd-vhosts.conf file to map a domain name to the correct port and document root.
What if netstat shows no process using the port?
If
netstat reports the port is listening but no PID is visible, a firewall rule or antivirus software might be blocking traffic rather than an application holding the port. Check your Windows Defender Firewall settings to ensure inbound rules are not interfering with local loopback traffic.
Does changing the port affect PHPMyAdmin?
Yes, PHPMyAdmin is served by Apache. If you change the Apache port to 8080, you must access PHPMyAdmin via
http://localhost:8080/phpmyadmin. Ensure your browser accepts cookies and sessions on non-standard ports to avoid login loops.
Is it safe to leave port 8080 open for development?
Using port 8080 is safe for local development environments. It isolates your testing server from standard web traffic, reducing the risk of accidental exposure to external networks. However, remember that external users cannot access your local server unless you configure port forwarding on your router.