Update: I no longer use this method. InstantWP provides a much easier solution for installing WordPress on Windows.
——————-
You may have noticed I changed my blog’s design.
I’ve wanted to do this for a while, but I kept putting it off because I knew I needed the time to customize the design, images, add my logo, etc.
If you’re starting a blog for the first time, then there’s no need for a WordPress testing environment. You can test everything live because no one knows your blog address yet.
But what if you already have a WordPress blog and you’re ready to switch to another design? You find a template that you like but notice some things you want to change (logos, other images, layout etc.)
Sure WordPress makes it super easy to switch template themes, but almost everyone wants to customize them in some way. And it’s better to do those things offline in case you mess something up.
No sense in letting your visitors see the new logo you uploaded that pushed your layout out of alignment. đ
So I did some searching around and found out how to install WordPress on my PC. It wasn’t as hard as I thought it’d be and only took a few minutes to setup.
It’s real convenient to have WordPress on your machine because you can test things out before launch. This is also handy if you’re making big changes to your blog or installing a plug-in for the first time.
Installing WordPress on Windows
1. First download the .exe version of XAMPP.
2. Place the .exe file in a folder of your choice (I put mine in C:\).
3. Double click the .exe file you just downloaded. A box will pop up asking you where you want to install it. Type C:\ (If it’s not already populated) and hit Extract.
4. Navigate to the install folder (C:\) and double click the file named xampp-control.exe.
5. Start the MySQL and Apache servers in the control panel window (See below.)
6. Now you should be able to go to http://localhost/ in your web browser.
7. Click the phpMyAdmin link in the left-hand column.
8. In the Create New Database box enter the words wordpress
9. In the MySQL Connection Collation box below select utf8_unicode_ci
10. Click Create and your database is all setup.
11. If you haven’t downloaded WordPress, please do so.
12. Unzip the folder and install it into the htdocs folder of your new directory. If you installed Xampp on your c drive then you would place the unzipped WordPress folder in c:\xampplite\htdocs
13. Inside the htdocs folder, open the file named wp-config-sample.php in Notepad or an ASCII editor (Not Microsoft Word!).
14. Look for the code below. Change the values so your code matches what is below. Don’t copy and paste. Just enter the values because your file may have more data. You don’t want to accidentally overwrite anything.
define(‘DB_NAME’, ‘wordpress‘); // The name of the database
define(âDB_USERâ, ârootâ); // Your MySQL username
define(âDB_PASSWORDâ, â); // âŚand password (Leave empty!)
The only thing you should need to change is the word wordpress for the database name. There may be a few extra lines in your file. You shouldn’t need to bother with this data.
15. Rename the file to wp-config.php and save it.
Note: If you’re using Notepad be sure to change the drop-down to “All Files” in the “Save As” menu or it will save it as wp-config.php.txt.
16. Point your browser to…
http://localhost/wordpress/wp-admin/install.php to install WordPress on your PC.
17. To view your blog’s local homepage simply go to…
http://localhost/wordpress
18. Now go and find a new WordPress theme and test away. Congratulations! You now have a local WordPress platform to test new themes and layouts on your WordPress blog.
Install Software says
Another great post.
Thanks for the tips and help.
Everyone, bookmark this site.
karl says
Got to the Control panel bit and only mysql will start ( running highlighted in green) , its says apache is started below but it does not have the green running next to it and the admin button is not lit up?
are these steps something you do in the xampp control panel
7. Click the phpMyAdmin link in the left-hand column.
8. In the Create New Database box enter the words wordpress
as at the moment i cant see a phpmyadmin link in the left hand column
thanks for any advice
Jake says
Lisa,
Great article. Just had a quick question about WordPress: Do you know if you can set it up so your blog posts can be exported to your website as a news module or something that sort? I’ve been googling this, but fear I must be using the wrong terminology or something. I’d love to set up a blog that also posts news stories to the main page of my website. Thanks for all your helpful resources!
Veitietoult says
Impressive Article , I considered it exceedingly great
I look forward to more innovative postings like this one. Does This Site have a newsletter I can subscribe to for anymore information from you?
CashParadise says
Thanks alot for this wonderful tutorial…
.-= CashParadise´s last blog … Three Easy Steps to Successful Affiliate Marketing =-.
Benja says
Beautiful tutorial, thank you lots Lisa!
Just a note to whoever might have issues:
1) to go ‘phpMyAdmin’ (in step 7) you need to click the ‘admin’ button next to the ‘MySQL’ database module shown in step 5 (may be that was only in d case for XAMPP install!)
2) take note of comment 27 while editing wp-config file, and
3) make sure you uncheck the ‘work offline’ mode for your browser (under file) if some reason u disabled your net connection before the installations.
janr3y says
thank YOU SOOOOOO MUCHHHH!!!!
=)…
John G says
Thank goodness someone came up with this. I was pulling my hair out (what little I have left!) trying to figure this out! The only way I could edit anything before was on the server side. Now if I only knew how to pull in an existing site (and make a local copy to edit) and then re-upload it back to the server!!
april says
hi there! i’ve been experimenting with wordpress in my local server using xampp for more than a month now. just a while ago, i experiences this problem.. my links to other pages won’t work. at first it was redirecting to xampp’s homepage. then i decided to uninstall xampp and install again.. now, when i click on the links for other wordpress page, it gives me this Object Not Found error 404. what could have gone wrong?
Bikin website says
I like this tutorial, thanks for making it.
Veronica Jones-Brown says
Hey, Lisa, thanks for this tutorial. I followed each step of the tutorial and it worked the first time.
Thanks again!
Eileen says
I have worked all the way through and followed your notes, putting WordPress in htdocs, etc.
When I go to change wp-config-sample it will not resave in the same file and I don’t know if I can put it somewhere else. The error message is “cannot save to this file”.
If I put it somewhere else i.e. wp-admin file, and I go to http://localhost/wordpress/wp-admin/install.php I get Object not found: Error 404.
Do you have any suggestions?
Thanks.
Nancy says
when I am navigat to http://localhost/wordpress/wp-admin/install.php
this comes up
Parse error: parse error in C:\xampplite\htdocs\wordpress\wp-config.php on line 77
can you tell me whats wrong?
lisa says
Hi Anton
You need to find out what folder WordPress is installed on your host and just upload your entire theme folder to that location and when you login to your WP admin panel you should be able to switch to that theme.
So I’m assuming you have all your WP files in a themes folder on your local machine. Simply upload this entire folder to the “themes” folder on your server and that’s all you should have to do.
You can upload the folder via an FTP program (recommended) or you can do it through your host’s control panel.
Anton says
I have installed completely WordPress framework on my local machine. However, I don’t know yet how to deploy it on my web host? My web host has already WordPress installed too using one click install Fantastico from my web host. Are you planning to write a new post about Deployment of WordPress to your web host? Or just email me, if you have another great idea.
Mark says
Just tried this and worked great! Only thing is, http://localhost/ doesn’t work but http://127.0.0.1/ does.
Pat says
Hi Lisa , trying to get xampp running but apache doesn’t find port 80 . My laptop is 64 bit does anyone else run xampp with 64 bit machine? Do you know if they have a 64bit version. It may be my problem.
Ronia says
Procedure of wordpress install is very lovely.
shady says
a very usefull guide, thanks for sharing
Gearoid says
Cheers for this, I’ve been trying to find time to convert a friends website to wordpress and this will help a lot… keep up the good work.
dakicka says
Well,
After re-reading your post again I realized I was making it more difficult than what it is! Disregard my questions as I realized the mistake I was making!
I was trying to put in my actual hosting account- wordpress database username and password instead of doing like you said:
define(âDB_NAMEâ, âwordpressâ); // The name of the database
define(âDB_USERâ, ârootâ); // Your MySQL username
define(âDB_PASSWORDâ, â); // âŚand password (Leave empty!)
thanks for your help as always, and thanks for keeping it simple and easy to read for us NON-TECHIES!
dakicka says
Lisa,
In follow-up to my above post, here is the EXACT THINGS I WROTE in the wp-config.php file
It still doesn’t work when I attempt to do the WP install via:
http://localhost/wordpress/wp-admin/install.php
Please Advise:
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘MYEXACTDBNAME’);
/** MySQL database username */
define(‘DB_USER’, ‘MYEXACTDBUSERNAME’);
/** MySQL database password */
define(‘DB_PASSWORD’, ‘MYEXACTDBPASSWORD’);
/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);
/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);
dakicka says
Hey Lisa,
I’m getting the “error establishing a database connection” when attempting to install wordpress after completing all the required directions for XAMPP and putting everything in the respective folders. I think it is because I don’t know what database name, user name, and password to enter in to plug in for:
define(‘DB_NAME’, ‘wordpress’); // The name of the database
define(‘DB_USER’, ‘root’); // Your MySQL username
define(‘DB_PASSWORD’, ”); // …and password
define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
Literally, I left everything exactly the same as above…
Please advise on what to fill in there and how to know what mysql username, password, etc. to fill in there, thanks!
Maricar says
Thank you so much for this tutorial. I’ve used it several times now to work on themes.
Amit says
I have completely install wordpress admin panel
but http://localhost/wordpress/index.php can’t load or display anything even i select classic theme from admin panel.
I have use php5.2.0,mysql 5.0.45 and phpmyadmin 3.1.2
please help me………
Nome says
thats really nice guide ! i must be try it !
Shane Swing says
Lisa,
Please allow me to share with your community a video tutorial I created to show how to install WordPress Locally with wamp.
http://www.youtube.com/watch?v=biQWyBcYSX4
Regards
Shane
Rana says
Hi Lisa,
Thanks. I tried your step by step above, it worked for me. I have just started learning WordPress Theme on my own pace.
jazzianbutt says
Hay Lisa!
I am pretty much confused that why themes are not appearing at my localhost, and when i put them on the server of my web host then everything is working fine, if anyone of you can give a solution then i will be thankful. because it would help me to test things locally.
lisa says
Hi Gage,
I didn’t have to replace localhost with anything. I just left it “as is” and it worked for me. Hmmmm…. not sure what to tell ya.
Gage says
I’m having some problems too, especialy with going to “http://localhost/wordpress”
I installed it and tried to put that in firefox but it just said it oculdn’t find it, I got the program who’s name starts with an X running, my guess is I’m supposed to replace “localhost” with something but I don’t know what.
jazzianbutt says
I am facing problem in installing new themes to my wordpress at localhost, i copied those themes folder to wp-contents/themes directory but still those theme are not visible at my admin panel
Jon says
Thanks so much for this guide Lisa – it worked brilliantly. The only problem I had was with starting Apache: for some reason it just wouldn’t run. To get round this I started it as a service and then rebooted my machine. (Thought I would mention in case anyone else has the same problem.) Everything was okay after this point. Thanks again đ
Jim says
Well it wasn’t a prompt. It was a drop-down that was available in the save box. Those four options that I previously sent were available. The default one was the ANSI.
No sweat. I appreciate you trying though. I like your blog. I’m just getting started with my dedicated wordpress site. I’ve been using their free one for some time.
http://www.ironbellathletics.wordpress.com
đ
lisa says
And I bet it’s something very simple we’re overlooking. It’s just hard to troubleshoot from this end. At first I thought it was maybe something to do with WordPress 2.6 but someone just told me they got it to work so that can’t be it.
One thing that I did confuse me was that you got that prompt about utf8 when you saved the wp-config file. I don’t remember getting prompted at that point. The only time I had to select utf-8 was in step 9 above.
Jim says
Oh, and I’ve already uninstalled and re-installed xampp and wordpress twice, and followed the instructions each time.
Maybe I’ll quit while I’m ahead and my computer still works…
Sorry, it sounds like a great tool.
Jim says
Yeah. Still no go. Here’s the new message I get:
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
lisa says
Hmmm…. and you installed wordpress in the htdocs folder?
Jim says
OK,
Everything’s entered as you posted. However, I’m still getting the error message as follows:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
07/27/08 17:26:03
Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8h mod_autoindex_color PHP/5.2.6
lisa says
Jim,
Use UTF-8.
The only thing you should have to enter in that group of code is the DB_NAME. Change that to wordpress and you shouldn’t have to alter the rest of the variables. I left “root” as is.
Jim says
Lisa,
When I save the wp-config file, I get an option to set the encoding to ANSI, UNICODE, UNICODE BIG ENDIAN, and UTF-8. Which should I use? Also, when I open the wp-config-sample file, I get the following options:
define(‘DB_NAME’, ‘putyourdbnamehere’); // The name of the database
define(‘DB_USER’, ‘usernamehere’); // Your MySQL username
define(‘DB_PASSWORD’, ‘yourpasswordhere’); // …and password
define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);
Am I correct to substitute ‘root’ for ‘usernamehere’?
The reason I’m asking, is because I can’t connect to my local host after several tries.
I hope you can help.
Thanks,
Jim
Johan Främst says
Right now your my Queen of the computer world! I Thought I had to struggel to get a test enviorment running, but I found your videos on youtube….. Now i gonna watch them all!!:-) Greetings from sweden!
lisa says
Whoops! Thanks for the correction, Fraz.
Fraz Khan says
thanks…. very useful…
and its UTF8_Unicode_Ci đ
lisa says
Thanks Johnny,
No, I just downloaded the WordPress template but did the customizations (created the logo, changed color of header in PhotoShop, etc.)
Johnny says
Thanks for the tips. I will need to read them again for them to sink in. Love the new look of the blog, did you create yourself? Very crisp…
Moin says
Very nice guide, I’ll try it đ
MoiN