Why would you want to setup WordPress on your PC? Well there are many reasons and it’s pretty easy to do.
One reason would be to test different themes out. Another would be to try different plugins. Yet another would be to see if you like this thing called blogging and test your wits at writing some blog posts. And yet another reason to run WordPress on your PC would be for software developers who are interested in developing plugins and/or playing around with and learning a thing or two from the WordPress code.
There are a couple ways that I know of right now that work well. The first and the one that I use is XAMPP.
XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows and Mac OS X. The package includes the Apache web server, MySQL, PHP, Perl, a FTP server and phpMyAdmin.
You can download XAMPP here at SourceForge.net, the world’s largest Open Source software development web site. When I download XAMPP, I download the executable for Windows. The current version as of this post on SourceForge.net is xampplite-win32-1.6.5.exe. The lite version if for local installs. In other words, for your PC.
After downloading and double-clicking on this file it will display a screen that asks you what folder you want to extract XAMPP to. I extract it to the root of my F: drive which is a secondary hard drive on my PC. You can certainly extract it to the root of your C:\ drive as well. What you end up with are a bunch of files and folders under C:\xampplite. The folder xampplite will be created for you.
Click here to see a list of Files and Folders. Double-click on the readme_en.txt file to follow the quick install instructions. The beautiful thing about XAMPP is that it is self-contained and can be copied here and there, hard drive to hard drive without affecting the default install. So if you install it on your C: drive and want to move it to your F: drive, you can. All you have to do is run setup_xampp.bat after you’ve copied it over to your F: drive.
When you first run XAMPP you’ll need to do the following just once:
- Double-click on setup_xampp.bat – wait for the “press any key to continue…” and you’re done with the first step.
- Unlike what the readme says, I double-click on the file xampp-control.exe. There will be a window in the lower-right hand corner of your screen that will allow you to start the Apache web server software and the MySql database software.
XAMPP Control Panel with Apache and MySql running.
Next, you’ll want to follow the readme file. Start your web browser, I’m currently using Firefox 2.0.0.11. Browse to http://127.0.0.1/ or http://localhost. You should see a setup page that will guide you through setting up the database for your WordPress install.
- Select your language – English in this case.
- Click on menu selection phpMyAdmin on the left-side of the web page.
- Under “Create new database”, enter wordpress. This will be the name of your database in MySql
- Select utf8_unicode_ci for the collation. This is the last selection in my drop-down list.
- Click on the “Create” button. Your database will be created and a web page will display that.
Once you’ve got your database setup, you can download WordPress here. You’ll need to unzip the contents to the C:\xampplite\htdocs folder. Click here to see the final folder structure.
Open the file C:\xampplite\htdocs\wordpress\wp-config-sample.php in a text editor and change the following:
- The DB_NAME will be wordpress in single quotes – ‘wordpress’
- The DB_USER will be ‘root’
- The DB_PASSWORD is blank. So delete whatever you have in there for the password. It should look like this – ”
- Close and save this file as wp-config.php
Browse to http://localhost/wordpress/wp-admin/install.php
You should see a WordPress install screen like this. Type in a blog title and provide your email address and click “Install WordPress”. The next screen will display your login and password. Write this information down and click on “log in”.
Finally the screen you’ve been waiting for, Ta-Da!!
After logging in you’ll be at your “Dashboard”. Click on “View site” next to the title of your blog for a quick, default view of your blog. Pretty cool. Not the best looking WordPress be nevertheless, we made it. What you’re seeing is considered the default WordPress theme. With the default install of WordPress comes two themes – WordPress and WordPress Classic. Both located under the “Presentation” menu.
But now, let’s browse over to download a more better (advanced english) WordPress theme called GreenTech WordPress theme. This bad-boy theme was created by Mayank Gupta and just released a couple of days ago by DailyBlogTips.
Download it and unzip it to C:\xampplite\htdocs\wordpress\wp-content\themes. You will have a folder structure like this – C:\xampplite\htdocs\wordpress\wp-content\themes\greentech.
There are a ton of WordPress themes scattered throughout the blogosphere. You can search for them on Google or just play around with this GreenTech theme and I’ll provide some other WordPress themes in a latter post you can check out.
So go back to your “Presentation” menu in WordPress and refresh it to make sure you see the new GreenTech – Two Column Widget Ready theme. Click once on it and your blog will now be using that theme. Click on “View site” to test drive it. Again, pretty darn cool if I do say so myself. You can get addicted to trying out WordPress themes which is okay for a while but make sure you get back to your normal routines so you don’t look suspicious hanging out at your PC all day and night.
Click here for a live demo of the GreenTech theme.
[techtags: XAMPP, WordPress, WordPress Themes, Apache, MySql]
George Joyce says
Can additional, different WordPress versions be added to the mix? If so, is there a point in the steps of your instructions where a new version can be installed, or is there another method?
Bill Stevens says
@George – You can run different versions side by side if you’d like. For instance a folder called wordpress23 and wordpress25 and their respective databases (2 different databases). See this link for help – http://www.thespinningdonut.com/how-to-run-wordpress-25-on-your-pc/
Osmium says
What’s the XAMPP link for my blog? my-ip.com/wordpress ?
Bill Stevens says
@Osmium – If you followed the steps above, it would be localhost/wordpress
Osmium says
And how do I setup XAMPP so that users not in my network can see my IP ?
Osmium says
Sorry,idiot question,don’t mind it,how do i setup XAMPP so that users not in my network can see my blog?
Abhinav says
Hey MAN!!!!
Thanks a F**KING LOT i finaly got through this damn thing !!
sorry for cussing…
but this wordpress thing i thought was one thing I could never get past (installation and all that jazz) but you made it possible!!
Thanks a lot once again! This blog is simply themost helpful for a n00b who is trying to set worpress up through xampp.
Also, in case you have a post regarding editing of themes, please care to email it to me!
Bill Stevens says
Woo Hoo!! Good job Abhinav. Check my article My first WordPress Theme – Part 1 for more information on editing themes. It’s a few parts and there’s more like this around the web, but it might help you understand what goes into WordPress themes.
Dipali says
Really !! Worth reading…
vaibhav says
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-login.php on line 255
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-login.php on line 267
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 649
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 650
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 651
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 850
after loggin with admin and password i got above error on my page
plz solve this
Bill says
Did you get that after you edited the wp-config.php file? If so, check for anything missing. I’m assuming you added the database name and login. Is that true?
Keith D says
I’m keen to start working with WordPress but can’t decide between XAMPP, Wamp and easy PHP for setting up a lical server.
I’ve got a Windows Vista machine.
Which of the above should I use to produce a local server?
Can anyone offer any advice.
Thanks
Keith D
Bill says
@Keith D – I’m using XAMPP all the time now. Both on Vista and XP. Testing on Windows 7.
Keith D says
Thanks Bill
I’ve read a couple of articles recently on setting up a local server for WordPress and they all specify XAMPP.
Your recommendation has made up my mind for me… XAMPP it is.
Many thanks
Keith D
Bob says
How many Blogs can I run on my computer.
Bill says
@Bob – As many as you want, as long as you have disk space. I would name folders like wordpress1, wordpress2, etc. and databases the same – wordpress1, wordpress2.
Jan Will says
Thanks so much! This post was really helpful !
Keith D says
Bill
I’m up and running with my XAMPP WordPress instalation and my wordpress version is 2.8.
Question… wordpress 2.8 has an automatic upgrade facility, but it doesn’t work on my local setup.
I’m sure that I’m missing something very obvious, but why can’t I use the wordpress automatic upgrade on my local server?
Frank Pezza says
Bill,
When I go to http://localhost or http://127.0.0.1/ all I get is a page that says “It works!”
When I try to Administer My Sql or Apache I get 404 error “The requested URL /xampp/ was not found on this server.”
What am I doing wrong? I am using Firefox Version 3.0.14. I am running Windows XP.
Bill says
@Frank: Were you able to run phpMyAdmin?
Keith Davis says
Hi Bill
Any idea how to modify XAMPP to enable email to be sent using form plugins for wordpress.
I’ve tried a few suggestions from the web, but not had any success.
Bill says
@Keith Davis: If I’m understanding your question right, I have no idea right now. I’ll have to look at that. Are you running the “real” (not xampplite) XAMPP on a server?
Frank Pezza says
Bill,
when I navigate to http://127.0.0.1/ all I get are the words “It works!”
I do not see a setup page. Is there another way to start phpMyAdmin?
Thanks for your help.
Keith Davis says
Hi Bill
I’m using full XAMPP not xampplite.
The form plugin I’m using is cformsII.
I’ve tried a couple of suggestins that I found on the web, but no results.
Frank Pezza says
It runs great now!.
I had a previous installation of MySQL. I uninstalled it and XAMPP. Re-ran the installation of XAMPP and all is well with the world. Thank you for your responses.
Frank
Heather says
Thanks a million! That was far too easy, and now I’m about to run 2 side by side by installing the backup copy of my online site. Hope I can do this with no problems too! Thank you so much!
Bill says
@Heather: Wonderful to hear. Thanks.
Heather says
@Bill
I managed to get 2 running side by side very easily, and have also managed to set up a gallery website, separate from WP using the guidelines above, as appropriate, and it was a complete doddle – that’s coming from me – a complete newbie to this kind of thing! Your page has been invaluable. I know I’ll need it again, so I’ve bookmarked it for the future. Thanks so much.
Heinrich says
Thanks for the great article! I have set up my first local server with wordpress installed 🙂
irvan says
Thank it’s works, i want to run my blog on my pc to backup my blog
and I use same sql from my online blog. thanks for your info
webeno says
Thank you very much for this post, it’s really the best!
I even linked to it in my blog post: etting Up WordPress On Your PC Using XAMPP
Abigail says
HI
When I put this in: http://localhost/wordpress/wp-admin/install.php
I get this: Error establishing a database connection
Can you help? Thanks
Bill says
@Abigail – Did you rename and save the wp-config-sample.php file to wp-config.php with the correct login information as used for the database?
Abigail says
Hi Bill
Yes I did rename it.. Is the DB file for password suppose to be changed to this? define(‘DB_PASSWORD’, ‘-‘);
RE: @Abigail – Did you rename and save the wp-config-sample.php file to wp-config.php with the correct login information as used for the database?
Abigail says
HI Bill Yes I renamed it. I have a question, is the password section of this file suppose to be changed like this? (‘DB_PASSWORD’, ‘-‘)
RE:
@Abigail – Did you rename and save the wp-config-sample.php file to wp-config.php with the correct login information as used for the database?
Abigail says
Hi Bill I keep getting this message. Can you assist? Thanks
– 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.
classroomblog says
Great guide. Setting up WordPress on XAMPP to test some things out and your instructions made it easy. Appreciate it. Thanks.
alexwfix says
I am trying to work with wordpress, but confuse between XAMPP, WAMP. Could you please advise me which should be good compatible with Windows XP.
vivek says
Good Article!
The Next step is to sync wordpress site on local machine from production server and for this, See Following
http://www.techbrij.com/238/setup-wordpress-on-local-xampp-from-production-server
Bill says
@vivek: Nice one. I’ll definitely have to try this.
Muhammad says
Just set up my own wordpress/xampp setup!! Thank you soo much!
This is so good to test quickly!
Beline says
Help ! (I’m French so I do apologize for my not-so-good English…)
I have the same problem than “vaibhav” (April 2, 2009 at 2:39 am) :
“Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-config.php:1) in C:\xampp\htdocs\wordpress\wp-login.php on line 255″
blah blah blah
I get that after I edited the wp-config.php file. Here is what I wrote :
/** Nom de la base de données de WordPress. */
define(‘DB_NAME’, ‘wordpress’);
/** Utilisateur de la base de données MySQL. */
define(‘DB_USER’, ‘root’);
/** Mot de passe de la base de données MySQL. */
define(‘DB_PASSWORD’, ”);
/** Adresse de l’hĂ©bergement MySQL. */
define(‘DB_HOST’, ‘localhost’);
Is it anything wrong ?
Could it be in that way because I had to delete the “wp-config-sample.php” file ?
Thx for helping me
Beline
Bill says
@Beline: Hi Beline, thanks for stoppin’ by. Compare the wp-config.php to the original or the sample and make sure no spaces at the top of the file or bottom. Start with that first.