How To Install WordPress Locally On Your Computer Using XAMPP
Why Do You Want A Local WordPress Installation?
First things first: Note well, this is not how you install a WordPress site on the internet. This is how you make a local installation of WordPress on your own computer.
Why would you want to install a WordPress site on your own computer?
So you can have a test bed WordPress site, where you can try out different themes and plug ins and layouts before taking the changes live online.
Why do you need XAMPP to do this?
Because unlike simple HTML pages, a WordPress site requires a database and a web server to work. XAMPP is a simple way to turn your own computer into a webserver you can access in your internet browser through http://localhost.
All clear? Good. Let's get started.
XAMPP
Fixing Vista To Allow Localhost Access
These are specific instructions for Windows machines, because that's what I use. If you're running Linux or a Mac - you're going to have to Google it. Sorry. This will work on Vista, and probably on XP too. If the downloads offer choices between Windows versions, choose the one your machine wants. NB: If you're running Vista, you need to fix Vista to allow localhost access, and this is how you do it:
- 1. Go to C:\Windows\System32\drivers\etc
- 2. Open the hosts file with Notepad, and change this line:
- ::1 localhost
- 3. -to this:
- #::1 localhost
- 4. Save the hosts file
NB: This is when you might get a message telling you the file can't be saved. This is how to get around it...
- 1. Right-click hosts and select Properties.
- 2. Click on the Security tab.
- 3. Click Advanced in the lower right.
- 4. In the Advanced Security Settings window, click on Owner.
- 5. Click Edit.
- 6. Click Other users or groups.
- 7. Click Advanced in the lower left corner.
- 8. Click Find Now.
- 9. Scroll through the results and double-click on your current user account.
- 10. Click OK to all of the remaining windows except the first Properties window.
- 11. Select your user account from the list and click Edit.
- 12. Select your user account from the list again and in the pane beneath, under Allow, check Full control.
- 13. You'll see a security warning. Click Yes.
Job done. Thanks go to Paul Stamatiou for solving that problem with this post
Download XAMPP
Go here to download XAMPP and get the gist of how to install it.
NB: Go with Method A: Installation with the Installer. Download the installer version: it's the easiest way to install XAMPP.
Save the installer version to your desktop. Close all other running programs and start it up.
NB: Install XAMPP to C:\xampp rather than to Program Files - this saves trouble with file permissions.
XAMPP Control Panel
Press The Buttons.
When you've got it going, press both the buttons marked with arrows in the photograph - Apache and MySQL - to start xampp working.
They'll change to say Running | Stop
Enter the address http://localhost/xampp/splash.php in a tab in your browser.
XAMPP screen
Navigate to phpMyAdmin
Once you have Apache and MySQL running, type http://localhost in your browser and navigate to phpMyAdmin.
Go Here For phpMyAdmin
phpMyAdmin
Create New Database. Then set the controls for the heart of the sun.
Where it says Create New Database, type wordpress and select utf8_unicode_ci, then press Create. You're done.
Download WordPress
Download the latest edition of WordPress to your desktop.
Unzip it, then find this file: wp-config-sample.php.
Open it up with Notepad. You need to fill in these details in the file:
define('DB_NAME', 'wordpress'); // The database name
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', ''); // - and password
define('DB_HOST', 'localhost'); // Leave this alone.
Note well: Keep a written note of these details. You'll need them in a couple of minutes.
NB: Rather than signing in as root, with no password, go to http://localhost > phpMyAdmin > Privileges > Add New User to add a user name and password with access to your wordpress database. Put the same user name and password into the wp-config-sample.php file and save it as wp-config.php
That done, copy the whole wordpress folder to:
My Computer > Main drive > Xampp > htdocs
And in your browser go to: http://localhost/wordpress/wp-admin/install.php -
Where you should find a WordPress install page. Fill in the user name and password you put in your wp-config.php file and sign in. (You did do what I suggested and made a written note of these, didn't you?) If all goes well, you should have a working WordPress install on your computer.
WordPress Login
And Now You've Installed WordPress Locally On Your Computer
Sounds like a pain? It can be, but I managed it in an hour or so one afternoon, after losing a previous local WordPress install in my Windows spring clean. (And if I can do it, I suspect it's pretty easy.)
Remember, if anything goes wrong, someone, sometime, somewhere on the internet has faced the same problem and dealt with it. Just Google 'install XAMPP' or 'install WordPress locally' and start from there - AFTER you make sure you haven't made a simple error.
What can you do with your local WordPress install?
- Try out different themes and plugins on a local copy of your website without breaking your real site online.
- Build your own themes and test them. Try different site layouts and stylings - change fonts and colours and images and use the best of what you learn on your online website.
A local WordPress install with XAMPP is well worth doing if it saves you some unwelcome surprises and design disasters.
Install WordPress Locally With XAMPP
Links To Online Articles and Downloads To Help You Install XAMPP
- WordPress; Blog Tool, Publishing Platform, and CMS
Everyone's favourite CMS. - apache friends - xampp for windows
XAMPP für Windows - How To Quickie: Vista Permissions — PaulStamatiou.com
A blog covering Tech News, Reviews, Guides and Startups from developer and startup guy Paul Stamatiou.