Today I've got a reader-requested tutorial about how you can install WordPress on your Windows 7 computer (same applies for Windows XP & Vista). This is such an important part of my WordPress working life, and if you don’t know how to do it, now’s your chance to learn. But first…..
Why Would I Want to Install WordPress on my Computer?
Installing WordPress locally gives you a fantastic test environment. You can install as many WordPress as you want on your computer. On mine I’ve got:
- Single-site
- Multisite
- Beta
- Plugins
- WordPress
This gives me all sorts of scope for testing stuff out, playing around – aWordPress playground right on my computer.
Let’s get started:
1. Download Xampp
Xampp is an Apache distribution containing MySQL, PHP and Perl. This makes it awesome for WordPress. You can download it from here.
There are a number of different distributions so make sure you select the distribution that’s correct for your operating system. For the purposes of this tutorial we want the Windows distribution.
Click on the distribution.
Click on the installer.
2. Install Xampp
Double click on the installer and choose your language.
Decide where you want to install xampp.
Click install.
Sit back, relax, wait for it to install.
3. Fire up Xampp
Start Xampp. Start Apache and MySQL.
You may get a warning from Windows. You want to make sure that Windows allows access.
You can check to see if your new local server is installed by visiting http://localhost
Nice!
4. Set up MySQL Database
On your Xampp control panel click the admin button beside MySQL.
In your browser you’ll be taken to the MySQL dashboard. You need to fill in the details for your new database:
- Set your MySQL connection collation: to utf8_unicode_ci
- Choose the name for your database. I’m naming this one singlesite – you can call it whatever you want.
Note: if you are doing a live installation on a server you must add a username and password. Do not use “root” ever on a live site. This isn’t necessary on a local installation.
5. Download and unzip WordPress
Download WordPress.
You need to unzip it to the correct folder on your computer. Find the Xampp folder and navigate to xampp>htdocs
Unzip WordPress there and rename the WordPress folder to whatever name you want. I usually match mine to my database name.
6. Configure WordPress
Open up wp-config-sample.php and find the MySQL settings.
Here is what you need to update the settings to:
/** The name of the database for WordPress */ define('DB_NAME', 'singlesite');
/** MySQL database username */ define('DB_USER', 'root');
/** MySQL database password */ define('DB_PASSWORD', '');
/** MySQL hostname */ define('DB_HOST', 'localhost');
Remember to replace singlesite with whatever you called your database.
Save the file in your root WordPress folder as wp-config.php
7. Install WordPress
Open up your browser and navigate to http://localhost/singlesite/
The familiar WordPress installation screen will appear.
Fill in your details and click “Install WordPress.”
There you go – WordPress is installed locally on your computer.
:)