Header Ads

How To Run WordPress Locally on Windows Using XAMPP

Install XAMPP & WordPress On Windows

Have you ever wanted to run WordPress offline?

Imagine a scenario where you have WordPress installed on your desktop & you can use it for multiple purposes like:

  • Testing themes.
  • Customizing themes locally.
  • Testing/developing plugins.
  • Writing posts disconnected from the internet.

There are many more situations where having an offline installation of WordPress is helpful. As far I know, most of the developers use offline WordPress as a testing environment.

If you are a beginner and looking forward to having an offline installation of WordPress on your Windows-based desktop or laptop, this is a step by step tutorial for you.

For this tutorial, I will be using XAMPP, which in layman’s language is something that lets you create a web server on your local machine.

Just to clarify, the term “local host” is synonymous to “Windows desktop/laptop”.

In the following tutorial, I will show you how to install XAMPP first & then how to set up WordPress. By the end, you will have WordPress up & running on your Windows System.

The following things will be covered in this mega tutorial:

  • How to download and install XAMPP on Windows.
  • How to set up a MySQL Database.
  • How to download and install WordPress on XAMPP.

Goal: To have WordPress up & running on Windows for offline usage.

Before we move on, let’s first understand about XAMPP and WordPress.

About XAMPP:

XAMPP enables the desktop to run web services such as PHP and MySQL which are the required components for running WordPress. In simple words, it enables all the necessary components that require running WordPress on your local machine.

XAMPP stands for cross-platform (X), Apache, MySQL, PHP, and PERL. Apart from Windows, it also works on other desktop OSs such as Linux & Mac.

About WordPress:

WordPress is the most popular CMS (content management system) out there.

According to a recent survey, WordPress is powering more than 27% of websites in the world. It’s completely free to use, secure, available in different languages, and offers powerful features like responsive mobile sites, SEO friendliness, media management, customizable designs, high security, etc.

You can learn more about WordPress in our earlier guide: What is WordPress?

Let’s begin with the process.

Installing XAMPP on Windows: Run WordPress Locally

XAMPP Installer

  • You will see a pop-up with a warning message whether you want to run the software or not. Click YES” and proceed further.
  • Click Next” to run the XAMPP setup.

XAMPP Setup

  • Select the components that you want to install along with XAMPP. By default, all the options are checked. Just in case you don’t need some, you can uncheck them.
  • Click Next” to proceed.

XAMPP Components

  • Select the installation folder where you want to keep XAMPP. By default, it will be installed in the C drive.
  • Click Next” to proceed.

XAMPP Folder

XAMPP Setup

  • You will see a screen that says XAMPP is ready to install.
  • Click Next” to proceed further.

XAMPP Installation

  • This will begin the XAMPP installation. Wait for a moment and let the installation process finish.

XAMPP Installation Process

  • Your windows firewall might ask for permission. If you see a screen like the one shown below, click on “Allow access” to the Apache HTTP Server.

Apache Server Access

  • This will finish up the XAMPP installation process.
  • Click Finish”.

XAMPP Installation Finish

  • Select the language in the next step and click “Save”.
    XAMPP Language
  • This will launch the XAMPP Control Panel.

XAMPP Control Panel

Bingo! You have successfully installed XAMPP on your local machine, and both Apache and MySQL are running successfully.

  • Typehttp://localhost” in your browser to confirm that XAMPP is installed on your machine. You will see something like this:

XAMPP Installation Confirmation

How To Set Up MySQL Database For WordPress

Before installing WordPress, we need to set up the database.

  • Click the Admin” option in the XAMPP Control Panel.

MySQL Database

  • This will redirect you to http://localhost/phpmyadmin (phpMyAdmin Interface) in your browser.

phpMyAdmin Interface

  • Go to Databases” and create a new table.

Creating Database

  • Name it anything you like and click Create”. I called mine “wordpress”.

Create Database

How To Download and Install WordPress on XAMPP

Time to install WordPress on XAMPP. To do this, head over to WordPress.org.

  • Click Download WordPress”.

WordPress Download

  • You will be redirected to the next page where you can download the latest version of WordPress.

Download Latest WordPress

  • WordPress will be downloaded in a zip format. To run WordPress on XAMPP, you need to unzip the WordPress zip file under the XAMPP folder. To do this, go to the XAMPP folder on your computer and open the htdocs folder. (Path would be C:/XAMPP/htdocs) and unzip WordPress there.
  • Open the WordPress folder and find the wp-config-sample.php file and rename it to wp-config.php “
    (just right click on the file and rename it).

Renaming File

  • Open the wp-config file in a text editor. In my case, I’m using Notepad++.
  • Scroll down until you find these lines:

Editing wp-config file

The above lines of code will define the login details for your database. Let’s replace those lines with the following:

  • Replace database_name_here with the name of your database, which in this case is wordpress.
  • Replace username_here with root.
  • Leave the password_here as blank.

Once you make the above changes, your wp-config file will look like this:

Editing wp-config file

  • Just save the file.
  • Type http://localhost/wordpress/ in your browser.

This is where the fun part begins. You will see the translation screen from where you can select your desired language for WordPress.

Select WordPress Language

  • In the next step, fill out your database, username, and click Submit”.

This will be same as what we did with the wp_config file:

  • Database name: wordpress
  • Username: root
  • Password: (leave blank)

Installing WordPress

  • Run the WordPress installation now.

Run WordPress Installation

  • Set up your Site Title, Username, Email, and Password and click Install WordPress”.

Setting Up WordPress

That’s it! You have successfully installed WordPress on XAMPP (on your local machine).

Now you will be redirected to the login page. Just log in with your credentials and play around!

WordPress Login

Once you are logged in, you will see the WordPress Dashboard:

WordPress Dashboard

What’s Next?

Well, now it’s up to you.

You can do anything you want like the stuff I mentioned at the start of this guide. You can also make a copy of your live site on your localhost for testing. For this, you can use the Duplicator plugin. Or you can use it to learn about WordPress.

Here are some tutorials that you can follow to make the most out your local WordPress installation:

I hope the above step-by-step guide helps you to run WordPress locally on Windows. If you have any questions or doubts, just post in the comments section, and I will surely help.

If you like the post, do share it with your friends and help them to learn WordPress!

Subscribe for more videos


Source: https://wpsutra.com/how-to-install-xampp-wordpress-on-windows/

No comments:

ANZICT. Powered by Blogger.