If you regularly tweek your blog’s design, layout or test plugins – I would recommend having a local version of your blog.
Hosting locally means running a duplicate copy of your live blog on your local machine. In other words, your PC becomes your web and database server.
Having your own development area is a bit like having your own playground, with freedom to test and tweek as you please without affecting the live system. Web developers generally adopt this approach before deploying.
Hosting your blog locally is a very straight forward process, and would require the following;
- Installing a web server on your computer.
- Creating a database.
- Downloading the latest version of wordpress.
- Tweeking one wordpress file.
There are several ways to achieve this, but one the easiest ways is using a tool called XAMPP, which happens to work across most operating systems.
Install a local web server
This is quite straight forward on a PC, simply visit http://www.apachefriends.org/en/xampp-windows.html to download and install XAMMP Lite executable file.
For Linux users, applying a few commands in your terminal should get you up and running. Simply visit http://www.apachefriends.org/en/xampp-linux.html for download and install instructions.
MAC users, download and extract XAMPP file from here http://www.apachefriends.org/en/xampp-macosx.html
Create and activate your database
Using the downloaded XAMPP tool, you can create a new database for your local blog. Simply open XAMPP control panel and select the Admin button next to MySQL. This should then take you phpMyAdmin page.
On this page, under MySQL Localhost section, you can create a new database name.
At this stage, to make sure everything is working fine, start the Apache and MySQL services, it will notify you once it starts.
You should also see the XAMPP splash screen when you type “localhost” into your browser.
Download and Extract WordPress
You can download the latest version of WordPress by visiting wordpress.com Once downloaded, extract the zipped file and move it inside the htdoc folder. On a windows machine, this can be located under c:\xampp\htdoc
Update your wp-config.php file
In this file, you will have to define your database parameters to enable connection.
In your wordpress folder, c:\xampp\htdoc\wordpress\
- Rename the file wp-config-sample.php to wp-config.php
- Define your database name – (‘DB_NAME’, ‘test‘);
- Define your database username – (‘DB_USER’, ‘root‘);
- Define your database password – (‘DB_PASSWORD’, ‘test‘);
Step 5 and final step
Configure and Install
Run install.php file by pointing your browser to http://localhost/wordpress/wp-admin/install.php and hit enter.
- At this stage, you then see the configuration file, complete the fields with the same information as your wp-config.php file.
- Complete your blog title along with your email address and hit Run install
- ALL DONE – You now have a copy locally.
To transfer files from server to local machine, I would recommend using a an FTP client such as FileZilla.
What are your thoughts on testing locally?