Setting up XAMPP on a Windows machine is not an easy task, let me tell you! But once installed, it is very easy to run and will save you a lot of time if you need to run WordPress locally. In fact, you will forget it’s there.
Having a localhost environment is an absolutely necessary part of my WordPress workflow, so I can not do my daily work without it. I set up new WordPress installs regularly for testing and running with new versions of themes and add-ons, and I also have multiple installs for the multiple sites configured.
The best thing about running a localhost installation is that your test site will run faster than the Internet, but if you want to make sure it continues to run at perfect speed, be sure to install and activate Hummingbird in the installation. The installation of localhost is also more secure and provides an ideal testing environment on the computer, away from prying eyes or hackers. Since then, XAMPP 7.2.11 has now been available and Windows itself has undergone some updates. This is a new and update guide for beginners how to configure XAMPP on Windows, with additional information about how to troubleshoot annoying ports and firewall.
What is XAMPP and how it’s work?
XAMPP means multiplatform, Apache, MySQL, PHP and Perl. It is a very easy and lightweight solution that allows you to create a local Web server for testing purposes.
On the other hand XAMPP is a multi-platform system, it also works on Mac and Linux, but today we’ll focus on how to configure XAMPP in Windows 10.
WordPress is not a stand-alone application and requires the server software to run it. XAMPP provides the environment necessary to run WordPress on a local machine.
Installing XAMPP on Windows 10
At first you have to download XAMPP. Go to the Apache Friends website and download the latest version of XAMPP for Windows 10.
After installing XAMPP. Let’s open the file and launch it to install.
During the installation process, you may receive some warnings such as Windows asking if you are sure you want to install the program and ask you to be prompted for an antivirus program. As with any program installed on Windows, use the best estimate, but you have to click “Yes” to continue the installation process.
The XAMPP Configuration Wizard will guide you through the installation. Click Next to move forward.
In the next window, you will be asked to select which program components you want to install and which ones you do not want. Some options, such as Apache and PHP, are necessary to run the program and will be installed automatically, so they are not active so you can not select them.
It’s all up to you which components you want to install. Since we want to run WordPress in our localhost environment, leave MySQL and phpMyAdmin selected and deselect the remaining options.
Then, select the specific folder where you would like to install XAMPP on your Computer. I’m going to create a new folder in C:\Program Files\XAMPP.
In the next window, you will be asked if you want to install Bitnami for XAMPP, which provides free tools to install WordPress, Drupal and Joomla. On the XAMPP header.
As we will manually install WordPress later in this tutorial and we will not need free installers, uncheck the “Get more information about Bitnami for XAMPP” option and then click Next.
After following all initial installation steps, XAMPP is now ready for installation. Click Next
Once installed, you will be asked if you want to start the XAMPP Control Panel, which provides an interface to run your local host environment. Leave this option selected and click Finish.
The control panel will open automatically, but if you deactivate the option in the previous window, you can go to the XAMPP folder on your computer and open the XAMPP control panel.
If the installation is successful and everything works correctly, the control panel opens with black and blue text updates at the bottom. But if there are problems …
Now, look at that image– there are some red text! It looks like I’ve run into some errors . Don’t worry, it’s a port conflict.
Fixing Port Error in XAMPP Installation
The main cause of XAMPP production for such errors is due to another program on your device that uses ports 80 or 443: the ports that Apache and MySQL needs to run for the installation.
If you are using Windows 10, the World Wide Web Publishing Service is most likely using ports 80. This software, which is intended for Internet Information Services (IIS) for Windows® Server, is pre-installed and if you do not use it simply you can turn off the service on your computer or even Delete it.
To stop the service running, do the following things:
- Go to Start, type in “services.msc” and select the best match
- Scroll down in the Services window to find World Wide Web Publishing Service
- Right-click on it and select Stop
- This should free up port 80. When you restart XAMPP it should run without errors
If that doesn’t solve the issue, you can set up a new firewall rule to forcibly unblock the ports:
- Open Windows Firewall on your Computer and > click on Advanced Settings on the left
- Click on Inbound on the left, then on the far right click New Rule
- Click Port and then TCP. In the field below for Specific Ports type in “80, 443” and click Next
- Check Allow the Connection then click Next
- Make sure all options are checked and click Next
- In the name field, enter whatever you want, but for the sake of consistency let’s type in LOCALHOST1. Click Finish
- Now repeat steps 1-6, but name this new rule LOCALHOST2 and click Finish
- After that Restart your computer
Ports 80 & 443 should now be open locally on your computer.
I should also mention at this point that if you receive any security / firewall warning when you install or use XAMPP (such as the message below), be sure to check “Private networks, such as your home or work network” and click “Allow access.” This is very important, if you do not allow access, XAMPP will not work.
Running XAMPP in Windows 10
Let’s see if everything works perfectly.
If you previously quit the control panel to fix a port issue, restart XAMPP. Then start up both Apache and MySQL.
Both services are running smoothly. Awesome!
If you want you can check your new local server is installed by visiting http://localhost in your windows 10 installed browser.
Setting Up Your MySQL Database
Before we install WordPress, we need a database.
In your XAMPP Control Panel, click the Admin button in the MySQL section.
Click on Admin in the MySQL row to launch phpMyAdmin.
A new browser window will automatically open with the phpMyAdmin interface.