Search

Wednesday 21 June 2017

How to Create a Local WordPress Website in Windows with Xampp | Step By Step Tutorial


I believe that all WordPress users should have a local installation of WordPress on their PC. The benefits are numerous – you can test themes, plugins, and fiddle with a blog’s design without anyone seeing. It’s lightning quick. There is no danger of being indexed by Google. You can even take a whole website, download it to a local WordPress installation, and play around with it to your heart’s content before uploading the changes.
But local installations of WordPress aren’t just for developers. For instance, I have an offline accountability blog that I use to keep track of my life goals. I have another local WordPress installation where I draft articles that I write for clients.
Whilst setting up a local WordPress website may instinctively feel like it would be a complicated process, in reality, it is not. Any competent PC user can have a local WordPress installation up and running within a few short minutes.

1. Download and Install Xampp

In order to install and run WordPress locally, you need to create a local server environment. Fortunately, this is easily done with a free piece of software called Xampp. You can download Xampp from this location – click on the “Installer” option:
Download Xampp
Double click on the installation file once the download has been completed. You will be prompted to enter an installation directory:
Install Xampp
It is recommended that you do not use the Program Files directory, because of potential write permissions issues. Please note that the directory you choose at this stage will be where your local WordPress site’s files are located.
Proceed through the installation process – there is no need to adjust any of the default installation settings.

2. Set Up Xampp

Once the installation process has completed, load Xampp and Start the Apache and MySQL modules:
Xampp
You may be presented with a security alert that looks something like this:
Windows Security Alert
You need to select “Unblock”. Once you have done so, the local server environment should be up and running. To check, open your browser and enter “http://localhost/” into the address bar. You should see something like this:
localhost

3. Create a Database

Every WordPress installation needs its own database, so before we install WordPress proper, we need to create one.
From the same screen where you Started the Apache and MySQL modules, select the MySQL Admin button. This will open up phpMyAdmin in a browser tab. Select the “Databases” tab – here you will create your database:
Create Database
You can use whatever name you want, but I would recommend something descriptive. Click on “Create”, and you’re done!

4. Download, Configure and Install WordPress

Grab yourself a copy of the latest version of WordPress from the WordPress.org home page. Once downloaded, unzip the file. I would recommend that you give the resultant folder the same name as your database.
Find the location where you installed Xampp (if you didn’t change the directory during installation, it will be “C:/xampp”), and open up the “htdocs” directory. Paste your WordPress folder into this directory. This is where your local website’s files will live.
Double click on your WordPress folder and open the “wp-config-sample.php” file with Notepad. There are a few variables you need to change in here:
wp-config
Obviously, your database name may not be “mytestsite” – it will be whatever you named your database in phpMyAdmin.
Once you’re done, save the file and rename it as “wp-config.php” (i.e. remove “-sample” from the filename).
The only thing left to do now is install WordPress using the 5 minute installation process (which in reality will take about 30 seconds).
Open up a fresh browser tab and navigate to “http://localhost/yoursitename/”, where “yoursitename” is the name of your WordPress site’s directory. You will be presented with a familiar screen:
WordPress Installation
Fill in the details, hit the “Install WordPress” button, and you’re done! You are now the proud owner of an offline WordPress site:
Offline WordPress Site
You are now free to edit and add to the site in whatever way you see fit. You have access to all themes and plugins as you would do with a “normal” WordPress installation. You can even add the site to your ManageWP account by using port forwarding. Furthermore, you can create as many of these sites as you wish, just by repeating steps 3 and 4.

No comments:

Post a Comment