Installing WordPress Offline
Posted on 04. May, 2009 by Julius.
At the beginning when I started blogging I didn’t know how to use WordPress correctly. I also didn’t have much experience with using WordPress.
Days after days I tried to play around with my WordPress theme but I always had to log into my WordPress blog. The problem was that it was not only slow to always change code in the Editor section, but it always changed the appearance of my blog.
This eventually led me to find a way to use WordPress offline. Using it offline has a lot of advantages:
- you do not use up your bandwidth
- it is a lot faster
- it just changes your local theme and does not change the look of your online blog
There is just one problem with installing WordPress offline. You usually need a server to run WordPress as it uses PHP, which is a programming language that is used on most web servers.
After trying several things out I became aware of XAMPP which solves the issue mentioned above.
What Is XAMPP?
XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use – just download, extract and start.
XAMPP is really useful as it packages all the necessary files in one distribution and makes the installation very simple.
Now let’s look at the steps you need to take in order to get your offline WordPress blog working.
Go and visit Apache Friends to download XAMPP. There are several different downloads depending on your platform.
After having downloaded XAMPP, double click on the file (in Windows). This should open up a new Window and start the installation.
Click Next to go to the next page. There you should be able to choose to which location you want to install XAMPP. If want to change the default location then click on Browse…
Again choose the Next button to get to the next page. Here you are prompted with options such as whether to add an icon to your desktop or not. Select the options you like and then click on Install.
Afterwards your computer should start to install XAMPP. When it’s done just click on Finish to close the installation.
XAMPP should now be installed so let’s take a look at making it ready for WordPress.
If you chose to add an icon to your Desktop then just double click on it, otherwise go to Programs -> Apache Friends -> XAMPP -> XAMPP Control Panel. You should now see a control panel similar to the one below.
Click on the two Start buttons next to Apache and MySql to start both of these servers. Now open up a browser after the servers are started. Type in the address: http://localhost/. You should now see a different control panel for XAMPP.
In order to make XAMPP more secure go to http://localhost/security/xamppsecurity.php . There you can change XAMPP’s default passwords.
It is very important to change the default passwords!
Setting Up the Database
The next step to take is to go back to the XAMPP browser panel (http://localhost/). In the navigation bar search for phpMyAdmin and click on it. A page similar to the one below should appear.
Add your user name and password into the boxes and click on Go.
After logging in, you have to create a new database. Look at the MySQL localhost section at which there should be section for you to create a new database. Let’s call the new database wordpress. Instead of the default MySQL connection collation choose utf8_unicode_ci (all the way at the bottom), then hit Create.
We now have created our WordPress database. All we now need to do is to download WordPress.
After downloading WordPress go to the directory where you have installed XAMPP. Then click on the htdocs folder to switch to it. You now have to extract all the WordPress files into a subdirectory of htdocs. You can do this by creating a subdirectory (of htdocs) named wordpress. If you choose to use a different subdirectory then you must adjust the blog path (http://localhost/wordpress/) at the end of the tutorial according to it.
Go to the wordpress directory and open up wp-config-sample.php in a text editor (Notepad will do just fine). You only need to change three lines, i.e. DB_NAME, DB_USER and DB_PASSWORD.
Change the default DB_NAME to wordpress, the database which we have created earlier. Then enter your phpMyAdmin username into DB_USER (the default is root) and also your password into DB_PASSWORD.
You don’t need to change DB_HOST since it is already set to the right host, i.e. localhost. Now you need to save the file as wp-config.php and you should be done setting up.
Before you can start though you probably need to go to http://localhost/wordpress/ (your blog address) and follow the default WordPress instructions to complete the WordPress installation.
You should then be able to visit your blog at http://localhost/wordpress/ and your Administration panel at http://localhost/wordpress/wp-admin/ .