Testing a new theme or plugin for developing them or just for normal usage in server is risky. Just imagine the risk when we try a new plugin or modify the theme’s CSS file : there are always many visitors are surfing the website; it happens the plugin or the modification in CSS file was not done rightly and, as the WordPress guy says “sky will fall on your head” : it really happens. We upgraded to WordPress 3.1 without thinking, unfortunately, it has some compatibility issues (which is rare for WordPress) with older plugins. The total website was a mess for few hours.
Here are the steps to install WordPress on Windows 7 locally on the hard disk, so that you can test themes and plugins offfline. Follow each and every step very religiously so that you can say “Code is poetry”.
Download the light version of XAMPP (known as XAMPPlite). Download the exe file. It is around 63.5 mb. Now, double click the installer file to install. Keep everything at default settings, do not change anything :
It will take around 15 minutes to get installed. From Start menu, click to start xampp control panel (or else, Go to the install folder, that is C:> xampplite and double-click the xampp-control.exe file).
Now, xampp control panel will open. Start up MySQL and Apache services one by one; Windows firewall will give you warning for Apache, accept it:
Now, open your favorite browser, we recommend using Mozilla FireFox for this purpose. In the address bar type:
and press Enter key from keyboard. An introduction screen will open asking you to select the language, select English and you will arrive here:
Now click on phpMyAdmin in the left column under Tools. We have placed the cursor over the option in above screen shot.
In the œCreate New Database Field, enter œwordpress (without quotes), and select utf8_unicode_ci in the drop down box in the next field. Click Create:
After few seconds, you will get the indication on the screen by a message saying “Database wordpress has been created.”
Now, we have to install WordPress. Download WordPress from WordPress.org and unzip it to C:xampphtdocs:
Now the important part. wp-config-sample.php ; Open it with any text Editor like Notepad, But we prefer to use gedit. You have to Edit only the lines 19, 22 and 25, namely :
19 define(‘DB_NAME’, ‘database_name_here‘);
22 define(‘DB_USER’, ‘username_here‘);
25 define(‘DB_PASSWORD’, ‘password_here‘);
You need not to change this line :
28 define(‘DB_HOST’, ‘localhost‘);
Change the database_name_here, username_here, password_here to that you have copied in your Notepad. Save it. Close it, again open it and recheck if they are correct. Close it.
Now, rename that wp-config-sample.php to wp-config.php …done! We are ready to install WordPress.
Update : Thanks to our reader Kathryn (see the comments) for pointing it.
Go to http://localhost/wordpress/wp-admin/install.php from your bowser:
Fill up the required fields and let WordPress allow few minutes to get installed. You will be able to log in and do anything you like to test. Here is our test blog:
Tagged With how to install WordPress offline
Maragaret Grandos says
What a great collection of great articles in your site. I hope I can make something of that quality one day Congratulations!!. I’ve been looking for this info in many sites related to this subject until I found your site! Thanks!
Thank you very much Margaret :)
I am glad these informations came to your work :)
Great and easy to use tutorial! I will be definately be using this method to install wordpress tonight!!!
Thank you so much… this was very easy to follow and so helpful.
there is one area though in the following line that might need clarification:
The above character at the end should actually be an open and close parenthesis (after the comma) and even though it may seem that’s what it is, it’s actually a quotation mark. if you copy and paste this code with the quotation mark, it doesn’t work. However, if you type it into notepad as an open and closed quotations there is a bit more space and it’s clear what it is. Hope that helps someone else… once I made the change everything worked fine!
So thank you!
Thank you very much Kathryn for the constructive input. It will really be helpful for others. We have edited it to make it more descriptive.
Really helpful guideline…I was needed it and made successful installation. Thank you.
Thank you very much Vidhi, for the input.
I am a web designer. How can i view multiple wordpress themes on localhost?
Abhishek Ghosh says
Yes, you can install multiple WordPress instances & apply different themes. In that way, you can check all the websites with various themes applied at the same time.
Obviously you can install multiple themes on single WordPress installation. I guess this not what you want.
You can do subdirectory installation of WP on localhost.