How to Install XAMPP and WordPress on Windows Localhost

How to Install XAMPP and WordPress on Windows Localhost

Once you’ve experienced speed and reliability, there’s no going back. Remember the era before high-speed internet, when you had to wait for videos to buffer? Awful times. Three cheers for the modern internet speeds!

If you’re used to developing your sites on a live server, that’s exactly what shifting to a local development environment such as XAMPP would feel like. Blazing fast development and exceptional reliability. You can never go back to the old ways.

In this post, I’ll be showing you how to install XAMPP on your Windows PC and have a WordPress site (including Multisite) running on it in just a few minutes. I’ll also cover some common issues that you may encounter and how to overcome them.

Let’s get going.

If you prefer a video instead, we’ve got you covered!

What is XAMPP?

In a nutshell, XAMPP is a local server that you can install on your laptop/desktop to mimic an actual web server.

It’s a completely free, open source Apache server distribution with MariaDB (formerly MySQL), PHP, and Perl. XAMPP is available for all major operating systems, and is extremely easy to install and use. This explains why it’s the most popular PHP development environment.

Here’s what the alphabets in XAMPP stand for:

  • X — cross-platform (X), as it supports multiple operating systems
  • A — Apache HTTP Server
  • M — MariaDB (formerly MySQL)
  • PPHP
  • P — PERL

Apart from the core components mentioned above, XAMPP usually comes with other useful tools such as Mercury mail server, phpMyAdmin for database administration, Webalizer for web server log analysis, OpenSSL, Apache Tomcat for running Java code, and FileZilla FTP server.

Why XAMPP?

As a professional WordPress developer, I cannot stress enough how beneficial having a local development environment is. It lets me setup new WordPress installs in a jiffy. And since it’s hosted locally on my computer, there’s no delay in uploading my changes and see them come alive on the browser.

Want to try a new theme? Just copy and paste it into your wp-content/themes directory. And bam! It’s loaded instantly. The same with plugins and changing any settings. No server delay, no upload hassles, no unnecessary waiting times. Everything happens in real time.

It’s like taking your car on a racetrack and pushing it to its limits. The perfect testing environment to go wild without any repercussions (well, almost).

With XAMPP installed on my PC, I can continue working on my site even if I’m at a remote location with no connectivity. Developing locally is also much secure, as your site is offline and away from the prying eyes of hackers (and pesky clients).

Why XAMPP for WordPress?

Like all software, WordPress has certain prerequisites to run. The current recommended WordPress requirements are:

  • PHP version 7.3 or greater
  • MySQL version 5.6 or greater OR MariaDB version 10.1 or greater
  • HTTPS support
  • Apache OR nginx server

XAMPP checks all the boxes listed above. It’s free, reliable, easy to use, and works on all major platforms. You can’t go wrong with it.

4 Steps to Install XAMPP on Windows

  1. Download XAMPP
  2. Install XAMPP 
  3. Open the XAMPP Control Panel
  4. Start Apache and MySQL Modules

Step 1: Download XAMPP

Start off by downloading the latest version of XAMPP from Apache Friends website. The current up-to-date version of XAMPP is 7.3.8 / PHP 7.3.8.

How to Install XAMPP and WordPress on Windows Localhost 1

Note: If you’re using Linux or OSX, the installation steps are pretty much the same. Just make sure to download the appropriate version of XAMPP for your OS.

Step 2: Install XAMPP

Once downloaded, run the XAMPP installer file.

How to Install XAMPP and WordPress on Windows Localhost 2The XAMPP Setup Wizard
How to Install XAMPP and WordPress on Windows Localhost 3You might get a UAC warning before installation. Click OK and continue.

Select the components you want to install. If you’re planning to install a WordPress site with XAMPP, you only need Apache, MySQL, PHP, and phpMyAdmin. I’ll check all the components as I’d like to experiment with them later.

How to Install XAMPP and WordPress on Windows Localhost 4

Choose the installation directory for XAMPP (default recommended).

How to Install XAMPP and WordPress on Windows Localhost 5

Uncheck Learn more about Bitnami option. Bitnami provides all-in-one tools to install popular open source apps on top of XAMPP. This includes add-on modules for installing WordPress too. However, we’ll be installing it manually here.

How to Install XAMPP and WordPress on Windows Localhost 6

You may be presented with a Windows Security Alert at the end of the installation. You need to whitelist Apache HTTP Server from your Windows Defender Firewall by clicking the Allow access button. Make sure to check the “Private networks, such as my home or work network” option. This is very important. XAMPP won’t work if you don’t check this and click Allow access.

Complete the setup and run XAMPP Control Panel.

How to Install XAMPP and WordPress on Windows Localhost 7

Installation Note 1: Deactivate UAC under Windows Settings

You might be presented with a User Access Control (UAC) warning by Windows. Nothing to worry much. Just make sure that you don’t install XAMPP under your Program Files directory, as UAC can interfere with XAMPP’s writing permissions to this directory. The default installation directory is C:XAMPP. So, if you don’t change it, you should be good.

If you want to learn how to deactivate UAC (not recommended unless absolutely necessary), Microsoft Windows support is a good place to start.

Installation Note 2: Deactivate Antivirus and/or Firewall Temporarily

Some antivirus or firewall programs can cause issues with your XAMPP installation. If that’s the case, it’s suggested that you deactivate them temporarily until XAMPP is installed successfully.

Read the XAMPP Windows FAQs page for more.

Step 3: Open the XAMPP Control Panel

The XAMPP Control Panel sports a simple user interface that lists all the modules of your local server. It allows you to Start/Stop individual modules, access their Admin area, Config files, and Logs with just a single click. Its bottom section also displays all your actions and errors (if any).

How to Install XAMPP and WordPress on Windows Localhost 8

Apart from the options discussed above, the XAMPP Control Panel also features other buttons on its right side:

    • Config: to configure overall XAMPP settings
    • Netstat: display all active TCP connections (and ports) on your computer
    • Shell: starts XAMPP in a custom command line (CMD)
    • Explorer: opens the XAMPP root folder in Windows Explorer
    • Services: shows all Windows services under Microsoft Management Console
  • Help: links to Apache Friends Support Forum
  • Quit: quit XAMPP Control Panel (the server will continue to run in the background)

Step 4: Start Apache and MySQL Modules

Click the Start button beside Apache module. If everything’s set correctly, your Apache server should start successfully under ports 83 and 443.

How to Install XAMPP and WordPress on Windows Localhost 9

You can access your Apache server’s dashboard by clicking the Admin button beside it. Alternatively, you can also reach it via http://localhost/dashboard/ URL in your browser.

How to Install XAMPP and WordPress on Windows Localhost 10

Then Start the MySQL module. If you’re presented with a Windows Security Alert to whitelist mysqld.exe, click Allow access. Like before, make sure that you’ve ticked the “Private networks,…” option.

How to Install XAMPP and WordPress on Windows Localhost 11

How to Install XAMPP and WordPress on Windows Localhost 12Don’t forget to tick the “Private networks” option.

You can access your phpMyAdmin dashboard by clicking the Admin button beside MySQL module. Or you can simply go to http://localhost/phpmyadmin/ in your browser. Here, you can manage the MariaDB (or MySQL) databases of your web projects.

How to Install XAMPP and WordPress on Windows Localhost 13

How to Install XAMPP and WordPress on Windows Localhost 14The phpMyAdmin Dashboard

This concludes the setup of XAMPP as your local development environment. It’s now ready to host any PHP-based software (e.g. WordPress).

Testing Your XAMPP Installation

The best way to check whether your local server has been installed and configured correctly is to create a PHP test page, place it in XAMPP’s localhost folder, and then try accessing it via your browser.

Let’s do that now. Create a new folder called test in your C:xampphtdocs directory. This directory can also be accessed easily by clicking the Explorer button in XAMPP Control Panel and then going to htdocs folder.

How to Install XAMPP and WordPress on Windows Localhost 15

Create a file called test.php with the code below and place it in C:xampphtdocstest folder.

How to Install XAMPP and WordPress on Windows Localhost 16
How to Install XAMPP and WordPress on Windows Localhost 17

Try visiting http://localhost/test/test.php in your browser. If it displays the words “Hello World! Welcome to WPMU DEV”, then XAMPP is successfully installed and configured on your system.

How to Install XAMPP and WordPress on Windows Localhost 18

Installing WordPress Locally with XAMPP

Step 1: Create a New MySQL Database for Your WordPress Installation

Before we install WordPress, we need a database.

In your XAMPP Control Panel, click the Admin button in the MySQL section. A new browser window will automatically open with the phpMyAdmin dashboard interface. Click on Databases near the top-left.

How to Install XAMPP and WordPress on Windows Localhost 19

You’ll now be prompted to create a new database. I’ve named mine wpmudev.

How to Install XAMPP and WordPress on Windows Localhost 20

Once you’ve entered a name, click Create and close the window.

Step 2: Download and Install WordPress

Download the latest version of WordPress.

How to Install XAMPP and WordPress on Windows Localhost 21

Unzip WordPress in the right folder under XAMPP. In my case, it’s C:/xampp/htdocs. Rename it to whatever you like, but it’s recommended to give this folder the name of your site. I’m going to call this installation of WordPress wptest.

How to Install XAMPP and WordPress on Windows Localhost 22

Now, go into your site’s WP folder, find the wp-config-sample.php file, and rename it wp-config.php.

How to Install XAMPP and WordPress on Windows Localhost 23

Open the file and scroll down until you see the following lines:

How to Install XAMPP and WordPress on Windows Localhost 24

These lines of code define the login details for your database. Update them as per the instructions below:

  • Replace“database_name_here” with the name of your database, which in my case is wpmudev.
  • Replace “username_here” with “root” and edit “password_here” field to be empty.
  • Save the file and close it

How to Install XAMPP and WordPress on Windows Localhost 25

We can continue with our WordPress installation now. Open your browser and go to http://localhost/wptest/.

How to Install XAMPP and WordPress on Windows Localhost 26

You should see the WordPress installation’s language selection screen load.

How to Install XAMPP and WordPress on Windows Localhost 27

Once you’ve chosen your language, continue onto the next screen. Enter your site title, admin username, and password details. Click Install WordPress.

How to Install XAMPP and WordPress on Windows Localhost 28

Congrats, you’ve successfully installed WordPress on your local server.

How to Install XAMPP and WordPress on Windows Localhost 29

Setting Up WordPress Multisite Locally with XAMPP

Step 1: Enable WP Multisite in your wp-config.php File

Open your wp-config.php file and add the following line just above the line that says /* That’s all, stop editing! Happy publishing. */.

define('WP_ALLOW_MULTISITE', true)

How to Install XAMPP and WordPress on Windows Localhost 30

This will activate the Multisite installation mode on your WordPress site.

Step 2: Setup Your Multisite Network

Go to your WordPress dashboard, and then to Tools > Network Setup.

How to Install XAMPP and WordPress on Windows Localhost 31

Enter a name for your multisite network and your network admin email address. Then click Install.

How to Install XAMPP and WordPress on Windows Localhost 32

WordPress will now prompt you to edit your wp-config.php and .htaccess files.

How to Install XAMPP and WordPress on Windows Localhost 33Follow the instructions given.

How to Install XAMPP and WordPress on Windows Localhost 34

Step 3: Follow WordPress’ Onscreen Instructions

Open your wp-config.php again and add the code given by WordPress underneath your previous edit.

How to Install XAMPP and WordPress on Windows Localhost 35

Next, open .htaccess file and replace all its code with the one given by WordPress (Note: you’ll have to replace the contents completely here, not just add/edit).

How to Install XAMPP and WordPress on Windows Localhost 36

If you can’t find the .htaccess file, make sure to enable display hidden files settings on your computer. If you still can’t find it, then create one in the same directory as your wp-config.php file.

How to Install XAMPP and WordPress on Windows Localhost 37

Multisite should now be successfully activated on your WordPress installation.

You’ll have to log in again. And when you do, you’ll be able to access individual sites in your multisite network from your dashboard.

How to Install XAMPP and WordPress on Windows Localhost 38
How to Install XAMPP and WordPress on Windows Localhost 39

You can also create a new network site from here by clicking the Add New button.

How to Install XAMPP and WordPress on Windows Localhost 40Adding a New Network Site

Troubleshooting Common Issues with XAMPP & WordPress

While my XAMPP and WordPress installation went wiithout a hitch, not everyone is so lucky. XAMPP can throw a curveball at you at any stage of its and WordPress’ installation. Here are some common issues associated with XAMPP (click to go to its solution):

XAMPPing Up

XAMPP allows you to set up a local server environment on your Windows machine easily. The best thing about it is that it’s completely free and open source. Once installed, you’ll forget that it’s even there. You can even install XAMPP on a USB drive along with WordPress.

With XAMPP, you can develop and test WordPress sites swiftly on your system, rather than doing it the hard way on a live site. You can try different themes and plugins, test their various features, and experiment with many other aspects of your site without breaking a sweat.

What’s more, you can also install as many instances of WordPress as you like (including Multisite). Who knew the saying “think global, act local” holds true for web development too!

Tags:

Keep reading the article at WPMU DEV Blog. The article was originally written by Salman Ravoof on 2022-01-15 06:00:00.

The article was hand-picked and curated for you by the Editorial Team of WP Archives.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

Your email address will not be published. Required fields are marked *

Show Your ❤️ Love! Like Us
Scroll to Top