Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install XAMPP Testing Server on PC: Step-by-Step

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To install XAMPP on a Windows PC, download the installer from the official Apache Friends website, run it, choose the components you need (Apache, MySQL, PHP, phpMyAdmin are the essentials), and complete the setup wizard. After installation, open the XAMPP Control Panel and start the Apache and MySQL modules to begin using your local testing server. This guide covers the full process, common pitfalls, and fixes.

What You'll Need

  • A Windows PC (Windows 10 or 11 recommended; older versions may work but are not officially supported).
  • Administrator rights on that PC (needed to install software and to let Apache bind to port 80).
  • At least 2 GB of free disk space (more if you plan to install all components).
  • A stable internet connection to download the installer (about 100–200 MB).
  • A web browser (any modern one) to test your server.

Step-by-Step

  1. Download XAMPP – Go to the official Apache Friends website (apachefriends.org) and click the download button for the Windows version. Choose the latest stable release (e.g., 8.2.x or 8.1.x). Avoid third-party download sites; they may bundle unwanted software.
  2. Run the installer – Locate the downloaded .exe file (usually in your Downloads folder) and double-click it. If Windows shows a User Account Control prompt, click “Yes” to allow the installer to make changes.
  3. Select components – The setup wizard will show a list of components. For a basic testing server, keep these checked: Apache, MySQL, PHP, phpMyAdmin, and Perl (optional). You can uncheck things like phpMyAdmin if you don't need a database GUI, but it's usually handy. Click “Next”.
  4. Choose the installation folder – The default is C:\xampp. Keep this default unless you have a strong reason to change it. Using a path with spaces (like C:\Program Files\xampp) can cause issues with some scripts. Click “Next”.
  5. Select language and shortcuts – The wizard may ask for a language (usually English). You can also choose to create a desktop shortcut and a Start Menu entry. Leave the “Learn more about Bitnami” option unchecked (it’s just a promo). Click “Next”.
  6. Start the installation – Click “Next” again, and the installer will copy files. This can take a few minutes. You’ll see a progress bar. Wait until it finishes.
  7. Finish the wizard – When done, you’ll see a final screen with an option to “Start the Control Panel now”. Leave it checked and click “Finish”. The XAMPP Control Panel will open.
  8. Start Apache and MySQL – In the Control Panel, you’ll see rows for Apache and MySQL. Click the “Start” button next to each. The status should turn green, and the port numbers (80 for Apache, 3306 for MySQL) should appear. If a module fails to start, see the Troubleshooting section below.
  9. Test your server – Open your web browser and type http://localhost in the address bar. You should see the XAMPP welcome page. If you see it, your server is running. To test PHP, create a file named test.php in the C:\xampp\htdocs folder with the content <?php phpinfo(); ?>, then visit http://localhost/test.php.
  10. Access phpMyAdmin (optional) – If you need a database, go to http://localhost/phpmyadmin in your browser. You’ll see the phpMyAdmin login page. By default, the MySQL root user has no password, so you can log in with username root and an empty password. For security on a local test machine, that’s fine, but if you plan to expose it, set a password.

Common Mistakes

  • Port 80 is already in use – Skype, IIS, or another web server may be using port 80. Apache will fail to start. You can either stop that program or change Apache’s port in the httpd.conf file (see Troubleshooting).
  • Installing to a path with spaces – Some PHP scripts and tools break when the installation path contains spaces. Stick with C:\xampp.
  • Skipping the Control Panel startup – If you close the installer without starting the Control Panel, you won’t see the server status. You can always open it later from the Start Menu.
  • Not running as administrator – The Control Panel may need admin rights to start services. Right-click the Control Panel icon and select “Run as administrator” if you get permission errors.
  • Forgetting to start MySQL – Many beginners only start Apache and then wonder why their database-driven scripts don’t work. Both Apache and MySQL must be running.

Tips

  • Use the Control Panel’s “Config” buttons – Each module has a Config button that opens its configuration file (e.g., httpd.conf for Apache). Use these to make changes rather than hunting for files manually.
  • Keep the Control Panel open – The server stops when you close the Control Panel unless you’ve installed it as a service (which is not recommended for a testing server). Keep it open in the system tray.
  • Create a shortcut to htdocs – Your web files go in C:\xampp\htdocs. Right-click that folder and choose “Pin to Quick access” in File Explorer for quick access.
  • Use a different port if 80 is busy – If you can’t free port 80, you can change Apache to listen on port 8080. Edit httpd.conf and change the line Listen 80 to Listen 8080. Then access your site via http://localhost:8080.
  • Back up your htdocs folder – Before upgrading XAMPP, copy your htdocs folder and your MySQL data folder (C:\xampp\mysql\data) to a safe location.

Troubleshooting

Apache fails to start – This is usually a port conflict. Open the XAMPP Control Panel, click the “Logs” button for Apache, and look for “Address already in use”. To fix, either stop the conflicting program (like Skype, which uses port 80) or change Apache’s port as described in Tips. Also, check that no other web server (IIS) is running.

MySQL fails to start – Often caused by a corrupted data directory or a previous MySQL process still running. First, try restarting your PC. If that doesn’t work, open the XAMPP Control Panel and click “Config” for MySQL, then edit my.ini and add innodb_force_recovery = 1 under the [mysqld] section, save, and try starting MySQL again. If it starts, remove that line and restart MySQL normally. If the data folder is corrupted, you may need to delete the mysql/data folder (after backing it up) and reinitialize – but that loses your databases.

“Access denied” when visiting localhost – Make sure you’re using http://localhost and not http://localhost:80 (unless you changed the port). Also, check that your browser isn’t using a proxy that blocks localhost.

PHP files download instead of running – This means Apache isn’t processing PHP. Check that the PHP module is enabled in httpd.conf. Look for a line like LoadModule php_module and uncomment it if needed. Also ensure you saved the file with a .php extension, not .html.

Windows Defender or antivirus blocks Apache – Some security software flags Apache as a threat. Add an exception for C:\xampp\apache\bin\httpd.exe and C:\xampp\mysql\bin\mysqld.exe in your antivirus settings.

If all else fails – Uninstall XAMPP completely, delete the C:\xampp folder (after backing up htdocs), and reinstall with the latest version. This fixes most corrupted installations.

Frequently Asked Questions

Do I need to install XAMPP as a Windows service?

No, for a testing server it’s better to run it manually via the Control Panel. Installing as a service makes it start automatically with Windows, which can slow boot time and is unnecessary for local testing.

Can I install XAMPP on a Mac or Linux?

Yes, Apache Friends provides installers for macOS and Linux, but the steps differ. This guide is for Windows. On Linux, you can also install Apache, MySQL, and PHP separately via your package manager.

What is the default MySQL root password?

There is no password by default. The root user has an empty password. You can set one later via phpMyAdmin or the MySQL command line.

How do I move my XAMPP installation to another drive?

It’s not recommended to move it manually. Instead, uninstall XAMPP, reinstall it to the new location, and then copy your htdocs and mysql/data folders over. Make sure to back up first.

Why does my localhost show the XAMPP dashboard but not my own files?

Your files must be placed inside C:\xampp\htdocs. If you put them elsewhere, Apache won’t serve them. Also, ensure the file name is correct (e.g., index.php or index.html).

Is XAMPP safe to use on a public network?

No, XAMPP is designed for local development. It has weak default security (no MySQL password, default ports). If you expose it to the internet, you risk unauthorized access. Use a proper web hosting service for production.