If you are new to WordPress development, you need to install WordPress on your local PC, because you can’t work on the web server, it is hard to work on the web server. You will face many issues like network problems and it is taking time to update files on the server repeatedly.
You can work using WordPress on your PC, you need to just install localhost like XAMPP and then install WordPress.
What Is XAMPP?
Basically, XAMPP stands for cross-platform, Apache, MySQL, PHP and Perl. It’s a simple and lightweight solution that allows you to create a local web server on your PC for testing purposes.
Remember XAMPP is a cross-platform software you can use it on Mac, Linux, and Windows. Now we install link it on Windows 10 PC.
WordPress does not work alone on your pc requires an environment as server and XAMPP gives you an environment like a server on your local PC.
First of all, you need to download XAMPP for Windows, Please go to the Apache Friends Website and download it.
After downloading the XAMMP, you need to install it. when you will start the install process, you may receive warnings such as Windows will ask you, if you’re sure you want to install the software and the installer prompting you about antivirus. As you would when installing any software on Windows, use your best judgment, but you probably want to click “Yes” to install it.
The Control Panel will automatically open after installation complete, but if you unchecked the option in the previous window, you need to go the XAMPP folder in your PC and open XAMPP Control Panel instead.
If the installation process went well and everything is running good, the control panel will open with black and blue text updates at the bottom. But if there are issues… … Well, look at that – red text! there are some errors already. Don’t worry, it looks like a port conflict.
The main reason why XAMPP Showing up errors like this is due to another program on your machine using ports 80 or 443 – the ports Apache and MySQL need in order to run. If you’re using Windows 10, World Wide Web Publishing Service is mostly using post 80. This program, which is for Internet Information Services (IIS) for Windows® Server, comes pre-installed and if you’re not using it, you can simply stop the service on your machine or even delete it. To stop the service running, do the following:
- Go to Start, type in “services.msc” and select the best match.
- Now 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 will restart XAMPP it should run without errors.
If that doesn’t resolve the issue, you can set up a new firewall rule to forcibly unblock the ports:
- Open Windows Firewall on your machine 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” then click Next.
- Check Allow the Connection then click Next.
- Make sure all options are checked and click Next.
- In the name field, enter as you want, but for the sake of consistency let’s type in LOCALHOST1. Click Finish.
- Now repeat steps 1-6, but with a new name this new rule LOCALHOST2 and click Finish.
- Restart your PC.
Ports 80 and 443 should now be open locally on your PC. I am also mentioning this stage that if you get any security/firewall warnings while installing or using XAMPP (such as the prompt pictured below), make sure you check “Private networks, such as my home or work network” and click “Allow access.” This is very important. If you don’t allow access, XAMPP won’t work.
Now, let’s see if everything works perfectly. If you previously quit the control panel to fix a port issue, then restart XAMPP. Now start up both Apache and MySQL. Both services will run fine. Excellent!
Setting Up Your MySQL Database For WordPress
Before we install WordPress, we need a for database WordPress. In your XAMPP Control Panel, click on the Admin button in the MySQL section. A new browser window will automatically open with the phpMyAdmin interface, like below image. Click on the Databases, you can see it near the top-left, and you’ll be prompted to create a new database. I’ve called mine “WP.” When you’ve entered a name, click on Create button and close the window.
Download and Install WordPress
Download the latest version of WordPress from wordpress.org. In order to install WordPress, you need to unzip WordPress in the right folder. Go to the XAMPP folder in your PC and open the htdocs folder – C:/Program Files/XAMPP/htdocs. Unzip WordPress into its own folder, you can also rename it whatever you like. For consistency, I’m going to call this installation of the WordPress “WP” to match the name of the database that I have just created. Open the WP folder where you saved WordPress and find the wp-config-sample.php file then rename it wp-config.php. Open the wp-config.php file and scroll down until you see the following lines: These lines of code define the login details for your database:
- Replace“database_name_here” with the name of your database, which is for me “WP”.
- Replace “username_here” with “root” and leave “password_here” blank.
- Save the file and close it.
Now we can get on with actually installing WordPress. Open the browser and go to http://localhost/wp/ You should see the translation screen that comes before the famous five minute WordPress installation process. Once you’ve chosen the language, continue to the next screen and enter your username and password details. Click Install WordPress. Your WordPress installation is now completed!
XAMPP provides an easy way to run a local server environment on your local Windows PC, allowing you to test and develop locally, rather than installing WordPress on a live site. It also saves your time since you won’t have to install and uninstall WordPress each time you test themes and plugins. The great is XAMPP is a free and open source product. You can set up as many installations of WordPress as you want and it’s just as easy to get running.