Install WordPress Locally on Windows with Xamp

১/০৮/২০১৩ ০৭:১৭:০০ AM | , | 0 comments »


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?

different local WordPress installation foldersInstalling 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 windows distributionClick on the installer.
click on the installer and select save

2. Install Xampp

Double click on the installer and choose your language.
choose your installation language
Decide where you want to install xampp.
choose the location for your installation
Click install.
click install
Sit back, relax, wait for it to install.
it might take a few minutes!

3. Fire up Xampp

Start Xampp. Start Apache and MySQL.
Click on the "Start" buttons beside Apache and MySQL
You may get a warning from Windows. You want to make sure that Windows allows access.
prevent windows firewall from blocking access
You can check to see if your new local server is installed by visiting http://localhost
xampp splash screen
Nice!

4. Set up MySQL Database

On your Xampp control panel click the admin button beside MySQL.
click the MySQL admin button on xampp
In your browser you’ll be taken to the MySQL dashboard. You need to fill in the details for your new database:
Insert the name of your database and choose utf_unicode_8 for collation
  • 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 passwordDo 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
location at c > 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.
find wp-config-sample in the wordpress folderHere 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
save your file as wp-config.php

7. Install WordPress

Open up your browser and navigate to http://localhost/singlesite/
The familiar WordPress installation screen will appear.
wordpress five minute install screen
Fill in your details and click “Install WordPress.”
There you go – WordPress is installed locally on your computer.
WordPress installed to localhost
:)