🏠 Home πŸ–₯️ Hosting 🎨 Themes πŸ”Œ Plugins πŸ› οΈ Dev Tools πŸ‘Ύ MonsterONE ⚑ WordPress πŸ”₯ Joomla!
Tutorial

9 Common XAMPP Errors on Windows and How to Fix Them

9 Common XAMPP Errors on Windows and How to Fix Them

⚑ Quick Answer

Most XAMPP errors on Windows come down to three causes: another program already using port 80, 443, or 3306; XAMPP not running with administrator rights; or a corrupted MySQL data file (usually ibdata1). Closing the conflicting app, changing the port in httpd.conf/my.ini, or restoring the MySQL backup folder fixes the vast majority of cases in under five minutes.

XAMPP bundles Apache, MySQL/MariaDB, PHP, and phpMyAdmin into one installer, which makes local development fast to set up but also means a single blocked port or a botched shutdown can take down the whole stack. This guide walks through the errors that show up most often in the XAMPP Control Panel and error logs on Windows 10/11, why each one happens, and the exact steps to fix it β€” without deleting data you don't need to lose.

1. Apache Won't Start β€” "Port 80 in use" or "Port 443 in use"

This is the single most common XAMPP error on Windows. The Apache row in the Control Panel turns red and the log shows a line similar to:

[Apache] Port 80 in use by "C:\Program Files\Skype\Phone\Skype.exe" with PID 4144!
[Apache] Apache WILL NOT start without the configured ports free!

Apache needs ports 80 and 443 exclusively. On Windows, the usual culprits are Skype, IIS/World Wide Web Publishing Service, VMware, a VPN client, or another local server (WAMP, Laragon, IIS Express) already bound to the same port. Sometimes the port shows as held by "PID 4," which is the Windows System process fronting IIS or the HTTP.sys driver, not a normal application.

  1. Open the XAMPP Control Panel and click Netstat to see which process is holding port 80 or 443.
  2. If it's an application you recognize (Skype, VPN client, another server), close it and click Start on Apache again.
  3. If the port is held by "PID 4" or the System process, open Services (services.msc), find World Wide Web Publishing Service, and stop it β€” this is usually IIS running silently in the background.
  4. If you'd rather keep the other program running, change Apache's port instead: click Config β†’ Apache (httpd.conf), find the line Listen 80, change it to Listen 8080, and update the matching ServerName localhost:8080 line just below it.
  5. Save the file and restart Apache. If you changed the port, access your sites at http://localhost:8080 instead of http://localhost.
XAMPP Control Panel showing Apache port 80 in use error message
XAMPP Control Panel showing Apache port 80 in use error message

2. MySQL Won't Start β€” Port 3306 Already in Use

MySQL/MariaDB listens on port 3306 by default. If you have a standalone MySQL installation, MySQL Workbench's bundled server, Docker, or a leftover WAMP install on the same machine, that service can grab port 3306 before XAMPP does.

  1. Open Command Prompt and run netstat -ano | findstr :3306 to find the PID using the port.
  2. Open Task Manager β†’ Details tab, find that PID, and identify the process.
  3. If it's another MySQL/MariaDB service, open services.msc, stop it, and set its Startup type to Manual so it doesn't restart automatically and conflict again.
  4. Alternatively, change XAMPP's MySQL port: click Config next to MySQL β†’ my.ini, change port=3306 to port=3307 under both the [client] and [mysqld] sections, save, and restart MySQL.

πŸ’‘ Note

If you change MySQL's port, remember to update the port number in phpMyAdmin/config.inc.php and in any application's database connection settings, or they will fail to connect.

3. "Error: MySQL Shutdown Unexpectedly"

This message is XAMPP's generic catch-all for a MySQL crash, and the real cause is buried in the MySQL error log, not the Control Panel window. Open C:\xampp\mysql\data\mysql_error.log (path may differ if you installed XAMPP elsewhere) to see the actual reason before making changes.

The three most common causes, in order of likelihood:

CauseHow to confirm
Port 3306 conflictLog mentions "Can't start server" or "bind on TCP/IP port"
Corrupted InnoDB system files (ibdata1, ib_logfile0/1)Log shows InnoDB errors or mentions a previous unclean shutdown/power loss
Missing permissions (XAMPP not run as admin, or installed under Program Files)Log shows "Access denied" or "Can't create/write to file"

If the log points to corrupted InnoDB files:

  1. Fully stop MySQL and Apache in the Control Panel.
  2. Copy the entire C:\xampp\mysql\data folder somewhere safe (e.g. rename a copy to data_old) β€” do not skip this step.
  3. Rename the original data folder to data_broken.
  4. Copy the contents of C:\xampp\mysql\backup into a new folder named data.
  5. From data_broken, copy your own database folders (skip mysql, performance_schema, and phpmyadmin, which are system folders) into the new data folder.
  6. Right-click the XAMPP Control Panel and choose Run as administrator, then start MySQL.

⚠️ Warning

Do not delete ibdata1 as a first step. It stores InnoDB's internal data dictionary; removing it without a backup can make your existing databases unreadable. Always copy the full data folder before touching anything inside it.

4. phpMyAdmin Shows "Error #1045 – Access Denied"

This happens when the username or password phpMyAdmin sends doesn't match what MySQL expects β€” usually after someone sets a root password manually but forgets to update phpMyAdmin's config file.

  1. In a default, untouched XAMPP install, the MySQL username is root with an empty password β€” leave the password field blank when logging in directly.
  2. If you did set a root password, open C:\xampp\phpMyAdmin\config.inc.php.
  3. Find the line $cfg['Servers'][$i]['password'] = ''; and enter the password you set between the quotes.
  4. Save the file and reload http://localhost/phpmyadmin.

5. "Forbidden β€” You Don't Have Permission to Access This Resource"

This 403 error usually appears when Apache's access rules block a folder outside htdocs, or when a virtual host's <Directory> block is missing the correct permission directive for Apache 2.4+.

  1. Open C:\xampp\apache\conf\httpd.conf and locate the <Directory "C:/xampp/htdocs"> block.
  2. Make sure it contains Require all granted (Apache 2.4 syntax) rather than the older Order allow,deny / Allow from all (Apache 2.2 syntax, which is ignored in 2.4+).
  3. If you're using a custom virtual host in httpd-vhosts.conf, add the same <Directory> block with Require all granted for that project's folder.
  4. Save both files and restart Apache from the Control Panel.

6. Localhost Refuses to Connect or "This Site Can't Be Reached"

This means the browser can't reach Apache at all, which is different from a 403 or 404 β€” it means nothing is listening on that address.

  1. Check the XAMPP Control Panel: if the Apache row isn't green, start it first β€” everything else depends on this.
  2. If you changed Apache's port earlier (see error #1), make sure you're browsing to http://localhost:8080, not plain http://localhost.
  3. Temporarily disable Windows Firewall or your antivirus's web-shield feature to check if it's blocking local connections, then re-enable it and add an exception for httpd.exe if that was the cause.
  4. Check C:\Windows\System32\drivers\etc\hosts to confirm the line 127.0.0.1 localhost hasn't been removed or commented out.

7. PHP Files Download Instead of Running, or Show Raw Code

This is a beginner mistake rather than a bug: it happens when a .php file is opened directly from File Explorer (using file:///C:/...) instead of being requested through Apache.

  1. Move your project folder inside C:\xampp\htdocs\.
  2. Make sure Apache is running in the Control Panel.
  3. Open the file through the browser address bar using http://localhost/your-project-folder/file.php β€” never by double-clicking the file itself.

PHP code only executes when a request goes through the web server; opening the file directly just shows it as static text or triggers a download.

8. XAMPP Control Panel Crashes on Exit ("EAccessViolation")

On Windows 10/11, closing XAMPP without administrator rights can trigger an Exception EAccessViolation error, or a message claiming it can't write to xampp-control.ini even though the file already exists.

  1. Right-click the XAMPP Control Panel shortcut and choose Run as administrator every time you open it.
  2. To avoid doing this manually each time, right-click the shortcut β†’ Properties β†’ Compatibility tab β†’ check Run this program as an administrator.

9. Windows Defender or Antivirus Flags or Blocks XAMPP

Because XAMPP installs a web server, a database server, and admin tools like phpMyAdmin, some antivirus engines flag it as "potentially unwanted" software. This is typically a false positive tied to the type of software it is, not evidence of an actual threat.

  1. Only ever download XAMPP from the official apachefriends.org site β€” third-party mirrors are a real risk, unlike the official installer.
  2. If Apache or MySQL won't start and no port conflict shows up, check your antivirus's quarantine or blocked-items list for httpd.exe or mysqld.exe and restore them if present.
  3. Add C:\xampp as an exclusion folder in Windows Security β†’ Virus & threat protection settings if your antivirus keeps interfering with normal operation.

❓ Frequently Asked Questions

Why does Apache fail to start in XAMPP on Windows?

Almost always because another program is already using port 80 or 443 β€” commonly Skype, IIS/World Wide Web Publishing Service, a VPN client, or another local server. Close the conflicting app or change Apache's port in httpd.conf to fix it.

What is the default XAMPP MySQL username and password?

In a fresh, unmodified XAMPP install, the username is root and the password is empty. If phpMyAdmin shows an access-denied error, check whether a password was set later without updating config.inc.php.

Is it safe to delete ibdata1 to fix "MySQL shutdown unexpectedly"?

Not as a first step. ibdata1 stores InnoDB's internal data, and deleting it without a backup can make existing databases unreadable. Copy the whole data folder first, then try restoring from XAMPP's built-in backup folder.

Why do I see a 403 Forbidden error at localhost?

Apache 2.4 requires Require all granted inside the relevant <Directory> block. Older Allow from all syntax from Apache 2.2 is silently ignored in 2.4+, which produces this exact error.

Do I need to run XAMPP as Administrator on Windows?

Yes, for most reliable behavior. Without admin rights, XAMPP can fail to bind system ports, throw errors when writing config files, or crash on exit. Set the shortcut to always run as administrator via its Properties dialog.

Why does my antivirus flag XAMPP as a threat?

Antivirus tools often flag bundled server software as "potentially unwanted" simply because it includes a web server and database admin tools, not because it's malicious. This is typically a false positive if downloaded from the official apachefriends.org site.

βœ… Last verified on XAMPP for Windows (PHP 8.2.12 / 8.1.25 / 8.0.30, Apache 2.4.58, MariaDB, phpMyAdmin 5.2.1) β€” September 2026
Thanh Le
Thanh Le
Joomla Specialist & Technical Writer

Thanh Le is a Joomla expert and technical writer at Jlvextension.com, known for creating in-depth tutorials, extension reviews, and optimization guides. His work focuses on helping developers and webs