WordPress Installation Locally using XAMPP
With localhost install, you can run your test site more quickly than online.It is more secure and provides you testing environment. So in this post we are providing details on WordPress installation locally. Here we are also explaining XAMPP installation. Because XAMPP is necessary for WordPress to run on your local machine.
1. Go to site Apache Friends website and download XAMPP.
Once you downloaded XAMPP file, double click on it to launch the installer. The file is about 107KB. While installing you may receive many warning messages, but to continue with installing you need to click on yes.
2. You will get Setup – XAMPP small window. Click on “Next” to continue.
3. In the next window you will be asked to select software you want to install. Since we want to install WordPress in our localhost environment, check MySQL and phpMyAdmin and uncheck the rest options. Apache, PHP are essential to run the software so it is checked by default.
4. In next step select the folder where you like to install XAMPP on your system. Here I created a folder called “XAMPP” in c drive- > program files and chose that as my installation folder.
5. Next, it will ask whether you would like to install Bitnami for XAMPP, which offers free tools for installing WordPress, Drupal and Joomla . Since we will install WordPress manually later in this post and don’t need free installers. Uncheck “Learn more about Bitnami for XAMPP” and click Next.
6. Now XAMPP is ready to install, click on next.
7. Once installation completed, you will get a window where you’ll be asked whether you would like to start the XAMPP Control Panel. Leave it as checked and click on finish. XAMPP control panel, provides an interface for running localhost environment.
8. If your installation process is successful, XAMPP control panel will open as shown below.
After installation, you may get Port errors, this is because another program in your system using ports 80 or 443. Apache and mySql need these ports in order to run. Follow below steps to resolve it.
1. Go to “Start” and search for “services.msc” and select “services”
2. Find “World Wide Web Publishing Service” in the services window and right click on it and stop
3. This will free up port 80 and when you restart XAMPP it will run without errors.
If your problem doesn’t solve by above steps, then you need to set up new firewall rule to unblock ports.
1. Go to Windows firewall and click on advance security in the left
2. Click on Inbound and then click on New Rule in the right
3. Click Port and then TCP. In the Specific local Ports field type in “80, 443” and click Next.
4. Select allow the connection.
5. Check all the options such as domain, Private, Public and click next.
6. In the name field type any name . Here I am giving “LocalHost”
7. Repeat above steps to create LocalHost2 and restart your computer.
Now, the ports80 and 443 are open locally. If you get any security warnings while installing XAMPP, you should check “Private networks, such as…..” and allow access. Otherwise XAMPP won’t work.
Next, restart your XAMPP control panel and start Apache and mySql.
If Apache and Mysql are highlighted with green, it means it is working fine. You can check whether your new local server is installed successfully by visiting http://localhost in your browser.
Set up MySql Database
Now, it’s time to setup MySql database. Before installing WordPress, we need to install MySql Database.
Go to XAMPP control panel and Click on Admin button in Mysql section.
You will be taken to phpMyAdmin page.
Click on “Database” tab at the top; now you will be asked to provide database name. enter a name to create it.
Next step is to WordPress installation locally. For this, first download the latest version of WordPress. Unzip your WordPress folder by creating a new folder in the path mentioned below. Go XAMPP folder, there htdocs folder- C:/Program Files/XAMPP/htdocs.
Go to WordPress folder where you saved WordPress docs, search for “wp-config-sample.php” file and rename it “wp-config.php”. Open the file to see the following lines.
Replace “database_name” with your database name. Username with root and leave password as blank. Save and close the file.
Go to browser and enter http://localhost/wp/, you will get translation screen. Select the language and click on continue.Where “wp” is name of database.
In next page enter your username and password and click on install.
Now, you are done with WordPress installation locally.