If you are used to developing your sites on a live server, this is exactly what it would look like to switch to a local development environment like XAMPP. Exceptional development and exceptional reliability. You cannot go back to the old ways.
In this post, I will show you how to install WordPress in xampp and run a WordPress site in just a few minutes. I will also cover some common problems you may encounter and how to overcome them.
Come on, let’s go.
If you prefer a video instead, we have you covered!
What is XAMPP?
To put it plainly, XAMPP is a neighborhood worker that you can introduce on your PC/work area to emulate a genuine web worker.
It’s a completely free and open-source Apache server distribution with MariaDB (formerly known as MySQL), PHP, and Perl. XAMPP is available for all major operating systems and is easy to install and use. This explains why it is the most popular PHP development environment.
Here is what the alphabet in XAMPP means:
X – cross-platform (X), because it supports multiple operating systems
A – Apache HTTP Server
M – MariaDB (formerly MySQL)
P – PHP
P – Pearl
Aside from the fundamental parts referenced above, XAMPP for the most part accompanies other valuable apparatuses like Mercury mail worker, phpMyAdmin for the database the executives, Webalizer for web worker log examination, OpenSSL and Apache Tomcat for running Java code, and FileZilla FTP worker.
Why Need XAMPP?
As a professional WordPress developer, I can’t stress enough how useful a local development environment is. Let me set up new WordPress installations in a snap. Since it is hosted locally on my computer, there is no delay in downloading the changes and seeing them come to life on the browser.
Want to try a new topic? Just copy and paste it into your wp-content / theme directory. And bam! It is loaded immediately. Same with plugins and change any settings. No server delays, no hassle loading, and no unnecessary waiting times. Everything happens in real-time.
It’s like taking your car on the racetrack and pushing it to the extreme. The ideal test environment for going wild without any repercussions (well, almost).
With XAMPP installed on my computer, I can continue to work on my site even if I am in a far place offline. Local development is also very safe, given that your site is out of the internet and out of the eyes of hackers (and annoying intruders).
Why need XAMPP for WordPress?
Like all programs, WordPress has certain basic requirements to run. The currently recommended WordPress requirements are:
- Support for HTTPS
- Apache server
- PHP 7.3 or higher
- MySQL version 5.6 or later or MariaDB version 10.1 or later
XAMPP checks all the boxes mentioned above. It’s free, solid, simple to utilize, and chips away at all significant stages. You can’t go wrong with that.
Let’s install XAMPP on Windows
Footstep 1: Download XAMPP
Start by downloading the most recent adaptation of XAMPP from the Apache Friends site. The current updated version of XAMPP is 7.3.8 / PHP 7.3.8.
Note: If you are using Linux or OSX, the installation steps are pretty much the same. Just make sure to download the appropriate version of XAMPP for your operating system.
Footstep 2: Install XAMPP
Once downloaded, run the XAMPP installation file.
Select the components you want to install. If you plan to install WordPress with XAMPP, you only need Apache, MySQL, PHP, and phpMyAdmin. I will check all the ingredients that I want to try later.
Choose the XAMPP Installation Guide (recommended by default).
Deselect Learn more about the Bitnami option. Bitnami provides all-in-one tools to install popular open source applications above XAMPP. This includes additional WordPress install modules as well. However, we will manually install it here.
You might see a Windows Security Alert at the end of the installation. You need to add the Apache HTTP server to the whitelist of the Windows Defender Firewall by clicking the Allow Access button. Make sure “Private System, for example, Home or Business System” is selected. This is very important. XAMPP will not work if you do not select this and click Allow Access.
Complete setup and turn on the XAMPP dashboard.
Installation Note 1: Deactivate UAC under Windows Settings
You may be presented with a Windows Access Control (UAC) warning. Nothing to worry about too much. Just make sure XAMPP is not installed within the Program Files directory, as UAC can interfere with XAMPP’s write permissions for this directory. The default installation directory is C: \ XAMPP.
If you want to know how to deactivate UAC (not recommended unless absolutely necessary), Microsoft Windows Support is a good place to start.
Installation Note 2: temporarily deactivate antivirus and/or firewall
Some antivirus or firewall software can cause XAMPP installation problems. If so, it is suggested to temporarily deactivate it until XAMPP is installed successfully.
Footstep 3: Open the XAMPP Control Panel
XAMPP dashboard has a simple user interface that lists all local server units. It allows you to start/stop individual units, access their admin area, configuration files, and records with just one click. The bottom section also shows all your actions and mistakes (if any).
Apart from the options shown above, the XAMPP dashboard also features other buttons on its right side:
- Explorer: The XAMPP root folder opens in Windows Explorer
- Services: Display all Windows services within the Microsoft Management Console
- Help: Links to the Apache Friends support forum
- Quit: Quit XAMPP Control Panel (the server will continue to run in the background)
- Configuration: Configure global XAMPP settings
- Netstat: View all active TCP connections (and ports) on your computer
- Shell: XAMPP starts in a custom command line (CMD)
Footstep 4: Run Apache and MySQL modules
Snap the Start button close to the Apache Module. If everything is set up correctly, the Apache server should start successfully under ports 83 and 443.
You can access the Apache server control panel by clicking on the admin button next to it. Alternatively, you can also access it via http: //localhost/dashboard/ URL in your browser.
Then start MySQL. If a Windows Security Alert is presented to the mysqld.exe whitelist, click Allow Access. As in the past, make certain to choose the “Private systems” alternative.
You can access your phpMyAdmin dashboard by clicking on the admin button next to the MySQL module. Or then again, you can just go to http:/localhost/PHPMyAdmin/in your program. Here, you can manage MariaDB (or MySQL) databases for your web projects.
The XAMPP setting thus ends as a local development environment. It is now ready to host any PHP based program (like WordPress).
XAMPP Installation Test
The best way to check if the local server is installed and configured correctly is to create a PHP test page, put it in the XAMPP localhost folder, and then try to access it via your browser.
Let’s do that now. Create a new folder called test in the C: \ xampp \ htdocs \ directory. This guide can also be easily accessed by clicking the Explorer button in the XAMPP control panel and then going to the htdocs folder.
Make a document named test.php utilizing the code beneath and place it in the C: \ xampp \ htdocs \ test envelope.
Install WordPress locally using XAMPP
Footstep 1: Create a new MySQL database to install your WordPress
Before installing WordPress, we need a database.
In the XAMPP dashboard, click the Admin button in the MySQL section. A new browser window will automatically open using the phpMyAdmin dashboard interface. Click Databases near the top left.
You will now be prompted to create a new database. I named mine wpmudev.
At the point when you’ve entered a name, click Create and close the window.
Footstep 2: Download and install WordPress
Download the latest version of WordPress.
Unzip WordPress in the right folder under XAMPP. For my situation, it’s C:/xampp/htdocs. Rename it to what you want, but it is recommended that you give this folder the name of your site. I will call this install from WordPress wptest.
Now, go to your site’s WP folder and find wp-config-sample.php and rename it wp-config.php.
Open the scrape and look down until you see the accompanying lines:
The lines of code specify the login details for your database. Update it according to 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 modify the “password_here” field to be blank.
- Save the file and then close it
We can continue installing our WordPress now. Open the browser and go to http: // localhost / wptest /.
You should see the WordPress install language selection screen download.
Once you’ve chosen your language, proceed to the next screen. Enter your website address, admin username, and password details. Click Install WordPress.
Congratulations, you have successfully installed WordPress to your local server.
Set up a multi-site WordPress site locally using XAMPP
Footstep 1: Enable WP Multisite in your wp-config.php file
Open the wp-config.php file and add the following line above the line saying / * that’s it, stop editing! Happy posting. * /.
Definition (‘WP_ALLOW_MULTISITE’, true)
Footstep 2: Set up your multi-site network
Go to your WordPress dashboard, then to Tools> Network Setup.
Enter a name for your multi-site network and email address for the network administrator. Then click Install.
WordPress will now prompt you to modify the wp-config.php and .htaccess.
Footstep 3: Follow the WordPress instructions on the screen
Open wp-config.php again and add the code provided by WordPress under your previous amendment.
Next, open the htaccess file and replace all of its code with the one provided by WordPress (note: you will have to replace the entire contents here, not just add / edit).
If you cannot find the .htaccess file. Make sure to enable Display Hidden File Settings on your computer. If you still can’t find it, create one in the same directory as wp-config.php.
Multiple sites should now be successfully activated on your WordPress installation.
You must log in again. When you do this, you will be able to access individual sites in your multi-site network from the control panel.
You can also create a new network site from here by clicking on the “Add New” button.
Troubleshoot common problems with XAMPP and WordPress
While my XAMPP and WordPress installation went without a hitch, not everyone is lucky. XAMPP can throw a curve ball at you at any stage of installation and WordPress. Here are some common problems associated with XAMPP (click to go to fix them):
- Maximum file size exceeded
- The thing was not found! Error
- Error: Apache stopped unexpectedly
- CURL Error 60: SSL Certificate Problem
- XAMPP cannot be installed on Windows
- Apache will not start without configured ports
- Unable to add or import additional menu items
- PHP maximum execution time exceeded