Common Errors When Using XAMPP on Windows

⏱ 5 min read 419 Updated May 4, 2026
Common Errors When Using XAMPP on Windows

XAMPP is a popular local development environment for Windows users. It allows developers to run Apache, MySQL, PHP, and phpMyAdmin directly on their computer. However, when using XAMPP on Windows, you may sometimes face errors that prevent Apache or MySQL from starting properly.

In this article, we will go through some of the most common XAMPP errors on Windows and how to fix them.

1. Apache Is Not Starting

One of the most common XAMPP errors is Apache not starting. This usually happens because another application is already using port 80 or 443.

Programs such as Skype, IIS, VMware, or another web server may conflict with Apache.

How to fix it

Open the XAMPP Control Panel and click Config next to Apache. Then open the httpd.conf file.

Find this line:

Listen 80

Change it to:

Listen 8080

Then find:

ServerName localhost:80

Change it to:

ServerName localhost:8080

Save the file and restart Apache. After that, open your browser and visit:

http://localhost:8080

2. MySQL Is Not Starting

Another common issue is MySQL not starting in XAMPP. This may happen when another MySQL service is already running on your computer, or when XAMPP was closed incorrectly and the database files became corrupted.

How to fix it

First, open Windows Services and check if another MySQL service is running. If it is, stop that service and try starting MySQL again from the XAMPP Control Panel.

If MySQL still does not start, create a backup of your xampp/mysql/data folder before making any changes. This helps protect your databases from data loss.

3. Port 3306 Is Already in Use

MySQL uses port 3306 by default. If another database application is already using this port, XAMPP MySQL will fail to start.

How to fix it

Open the MySQL configuration file:

xampp/mysql/bin/my.ini

Find this line:

port=3306

Change it to:

port=3307

Save the file and restart MySQL from the XAMPP Control Panel.

4. phpMyAdmin Access Denied Error

Sometimes, phpMyAdmin may show an Access denied error. This usually happens when the MySQL username or password does not match the phpMyAdmin configuration.

How to fix it

Open the phpMyAdmin configuration file:

xampp/phpMyAdmin/config.inc.php

Check the username and password settings. In a default XAMPP installation, the MySQL username is usually:

root

The password is usually empty unless you have changed it manually.

5. Localhost Is Not Opening

If localhost does not open in your browser, Apache may not be running, the port may have changed, or your firewall may be blocking the connection.

How to fix it

Make sure Apache is running in the XAMPP Control Panel. If you changed the Apache port to 8080, use this address:

http://localhost:8080

Also check your firewall or antivirus settings if the page still does not load.

6. PHP Files Are Not Working

A common beginner mistake is opening PHP files directly from the computer instead of running them through localhost.

Incorrect way:

C:/xampp/htdocs/test.php

Correct way:

http://localhost/test.php

PHP files must be placed inside the htdocs folder and opened through the browser using localhost.

7. Project Files Are in the Wrong Folder

XAMPP serves websites from the htdocs folder by default. If your project files are outside this folder, they will not load correctly in the browser.

How to fix it

Place your project folder inside:

xampp/htdocs

For example:

xampp/htdocs/myproject

Then open it in your browser:

http://localhost/myproject

Final Thoughts

XAMPP is a very useful tool for local web development on Windows, but errors can happen when ports are already in use, services conflict, or files are placed in the wrong directory.

Most XAMPP problems are easy to fix once you understand the cause. By checking Apache ports, MySQL settings, phpMyAdmin configuration, and the correct project folder, you can quickly solve the most common XAMPP errors on Windows.