WordPress is not a program or software that is installed like any other And that’s it, like any other web page (non-compiled code) it needs a PHP server to work, like Apache, that can interpret and execute your code.
WordPress can be installed locally on a Linux machine and make it work, but for a normal user (without technical knowledge) this can be complicated, especially when you need a computer with Linux installed and also because you have to know how to deal with the console.
Fortunately, there are others simpler solutions like XAMPP distributions, WAMP, MAMP, etc. In this case, we will install WordPress together with XAMPP, following the entire process step by step in Windows.
Specifically, this tutorial will consist of the following sections:
- review of xampp installation.
- Fix basic errors that may arise in XAMPP.
- WordPress download and basic setup with XAMPP.
- creation of database for WordPress.
- WordPress installation on localhost.
- XAMPP Installation
- Possible XAMPP errors
- WordPress installation on localhost
- Get WordPress files
- Create the database in MySQL
- The WordPress installer
If you do not have XAMPP installed, then I will explain how to do it. If you prefer a more complete tutorial, you can read our article dedicated to installing XAMPP on Windows.
First, we need to download XAMPP. To do this we will go to the official XAMPP page and download the corresponding version for Windows.
Once downloaded, we will run the installer.
During the installation, it is possible that Windows warnings will appear asking if you want to install the program, in this case we will click on “Yes”. This appears by default, but depending on how Windows is configured, it may not appear.
Once the installer has started, we will click on “Next”.
In the next screen of your installation, the first important configuration of XAMPP will appear (see the image). Apache, MySQL, PHP and PhpMyAdmin are essential to use XAMPP with WordPress, being the rest of the expendable options. Make sure these are checked before proceeding.
When you continue, the XAMPP installation path will appear, which can be changed depending on where you are going to install the program. In my case I will leave the default route.
In the next window the option to install will appear. Bitnami, an automatic installer for CMS WordPress, Joomla and others. In this case we are going to do the WordPress installation manuallyso we will uncheck that box:
After this, the XAMPP installation will start.
When the installation is finished, an option will appear to start the XAMPP control panel, we will leave this box checked and click on “Finish”.
NOTE: If you uncheck the option you will have to manually run the program, searching for it in the Start Menu or going to the installation path.
Now, we will click on “Start” in both Apache and MySQL and everything should be fine, if not, it is because errors have occurred. If this happens, you can review in the following section how to solve the errors that I have been finding.
To definitely know that everything is working correctly, we can write “localhost” in the address bar of the browser. A window similar to this should appear:
!! Congratulations!! This means that everything works correctly.
Possible XAMPP errors
In general, when something goes wrong, a red text will appear indicating the error, although it is not usually very descriptive, but rather indicative.
The most common error in this type of program is usually the ports. For this case, there is already a guide that explains how to change the default ports (Hiperlink), where the details are explained. Although to be brief, it can be fixed by looking at which program is interfering with ports: 80, 433 and 3306 in the “Netstat” utility, ???top right.
I recommend that you read our tutorial to change the port of XAMPP in Windows.
Other types of errors may also appear, referring to the firewall, but we will solve these in another article.
WordPress installation on localhost
The installation of WordPress on Windows is divided into 3 clear parts:
- Download the official WordPress files.
- Create a database for your installation.
- Use the WordPress installer and follow its interface.
Get WordPress files
Once both Apache and MySQL are up and running, we will need to install WordPress. To do this, we will go to the official WordPress page and download the ZIP of the latest version.
Create the database in MySQL
Once we have the files, we will have to create a database for WordPress can work. To do this, we will write “localhost/phpmyadmin” in the browser or click on the MySQL “Admin” button in the XAMPP control panel.
So, it will load the MySQL configuration tab:
To create a new database, we will click on “New” on the left, above the databases menu.
In my case I will put “wordpress” as the name. After that we will click on Create.
Then, when linking the database to WordPress, we will need a user, which already exists, “root”, but it does not have a password, so the ideal would be to assign it a password.
To do this, we will go to the “privileges” option, selecting the database before, then going to “Edit privileges” and then, in “Change password” it would be changed.
Once this is done, we will install WordPress.
The WordPress installer
Since we have decided install WordPress manuallywe will have to copy the ZIP files in the XAMPP “htdocs” folder, emptying it before or, creating a folder to store only this website.
I have chosen to leave the files in htdocs to work in a simple way this example:
Now we must indicate, in the browser (the url), the place within the folder htdocs where we have stored the WordPress files. In our case, being in the root folder, we will put “localhost” in the browser again, but this time the WordPress installation window will appear (since we have deleted the files that were in the htdocs folder).
On the screen that appears in the browser WordPress asks us for certain data. First we will select the language and then, on the second screen, a page will appear in which we must enter the information from the database that we have previously created:
You have to make sure that you put the data correctly, otherwise a message will appear saying that a connection to the database could not be established.
Once this is done, a window will appear with a button to start the installation. When clicking on it, a section will appear in which we will enter the WordPress user data, where we will write the username and password with which we will log in to the administration panel of our website.
Finally, a message will appear stating that the installation has been completed, taking us to the WordPress administration panel login, which we can access from “localhost/wp-admin” whenever we want.
!! Congratulations!! With this you already have WordPress installed and functional on your local web server.