The best approach to learning is playing. This is also true for WordPress. Even when you have mastered WordPress and your blog is up and running steadily, it is good to have a local WordPress installation for testing new versions of WordPress, themes and plugins. Or develop new websites. Your own, or your clients’.
A prerequisite for a local install of WordPress is a local web server. When you do not have a local web server yet, Install a XAMPP web server on your Windows PC in five easy steps will show you the way.
Here we are going to install and configure WordPress on a local web server, so I assume you have one.
Step 1 – Downloading WordPress
The best place to get a recent copy of WordPress is WordPress.org. There is even a shortcut that will always deliver the latest, stable version as a zip file. Currently, that is 4.1.1.
Extract the zip file when the download has finished. You end up with a folder named wordpress.
Step 2 – Moving to the web server
Now we have to move the wordpress folder to the document root of the local web server.
When you have followed along with the post Install a XAMPP web server, you have to move the folder to C:\xampp\htdocs.
Rename the wordpress folder by giving it the desired name of your local website. You will append that name In the address bar of the browser to http://localhost/.
In this example, I name the WordPress folder wpfyme.
That is it. The WordPress site wpfyme is now installed.
Step 3 – Creating the MySQL database and user
Before we continue configuring the WordPress site, we have to create a MySQL database and user.
We need a database to store our content and the configuration settings of WordPress, themes, and plugins.
In addition, we need a user with the proper privileges to access and modify the data in the database.
Creating the MySQL database
Make sure that the web server is running.
Fire up your browser and enter http://localhost/phpmyadmin in the address bar – or click the link. This will launch phpMyAdmin.
Enter the name for the database of your local website in the “Create new database” field.
On local installs I prefer to assign the same name to the database and the website folder inside htdocs. This is not necessary, but it makes pairing a local site and its database a lot easier – especially when you have a couple of dozen on your PC.
Here, I enter wpfyme. Hit the [Create] button.
A confirmation message pops-up, and the new database appears in the left sidebar.
Creating the MySQL user
Click the User tab.
- at the User name, select “Use text field”
- enter the desired database user name – here “db_user”
- from the Host drop-down menu, select “Local” – phpMyAdmin enters “localhost” for you
- at the Password field, select “Use text field” and enter the password for the database
- click the Check all checkbox
- hit the [Go]-button in the right lower corner
Done. You have created a MySQL database and a MySQL user.
Remember the database and user name, you need these for the configuration of WordPress – the creation of the wp-config.php file.
Step 4 – Configuring WordPress
Are you ready for the final sprint?
Enter the name of the local website in the address bar of the browser – that is the name you have given to the WordPress folder in htdocs. For me that becomes http://localhost/wpfyme.
Set the language
Here, I accept the suggestion – English (US). Make your choice and hit the [Continu]-button.
Welcome to WordPress
Create the wp-config.php
By giving the tables of each WordPress website a different table prefix, you are able to store data from several WordPress installations in the same database. Most of the time this is not very practical or necessary, but it could be a workaround when you exceed the maximum number of databases with you host.
The default table prefix is wp_, but is it advised to create your own.
Press [Submit]. No we have a wp-config.php file, stored in the WordPress root folder.
All right, sparky!
Otherwise, verify the details in the form above with the database details (database name, user name and password) as created in Step 3.
Hit the [Run the install]-button. Just one more form before you can log in to WordPress.
Five minute installation
Hit the [Install WordPress]-button.
When you see the WordPress’ Success! Screen, you know that you have succeeded and are done.