Setting Up WordPress On Your PC Using XAMPP

by Bill on January 17, 2008

WordPressWhy 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:

  1. Double-click on setup_xampp.bat – wait for the “press any key to continue…” and you’re done with the first step.
  2. 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

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.

  1. Select your language – English in this case.
  2. Click on menu selection phpMyAdmin on the left-side of the web page.
  3. Under “Create new database”, enter wordpress. This will be the name of your database in MySql
  4. Select utf8_unicode_ci for the collation. This is the last selection in my drop-down list.
  5. 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:

  1. The DB_NAME will be wordpress in single quotes – ‘wordpress’
  2. The DB_USER will be ‘root’
  3. The DB_PASSWORD is blank. So delete whatever you have in there for the password. It should look like this – ”
  4. 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!!

WordPress Login

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]

If you liked this article, please consider subscribing to The Spinning Donut to receive free articles by email:

{ 38 comments… read them below or add one }

1 George Joyce June 13, 2008 at 7:53 am

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?

2 Bill Stevens June 13, 2008 at 7:47 pm

@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/

3 Osmium October 31, 2008 at 1:35 pm

What’s the XAMPP link for my blog? my-ip.com/wordpress ?

4 Bill Stevens October 31, 2008 at 4:31 pm

@Osmium – If you followed the steps above, it would be localhost/wordpress

5 Osmium November 1, 2008 at 7:29 am

And how do I setup XAMPP so that users not in my network can see my IP ?

6 Osmium November 2, 2008 at 2:29 am

Sorry,idiot question,don’t mind it,how do i setup XAMPP so that users not in my network can see my blog?

7 Abhinav December 21, 2008 at 8:51 am

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!

8 Bill Stevens December 22, 2008 at 2:03 am

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.

9 Dipali January 16, 2009 at 11:53 pm

Really !! Worth reading…

10 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

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

11 Bill April 3, 2009 at 10:03 pm

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?

12 Keith D May 9, 2009 at 10:22 am

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

13 Bill May 10, 2009 at 9:48 am

@Keith D – I’m using XAMPP all the time now. Both on Vista and XP. Testing on Windows 7.

14 Keith D May 10, 2009 at 10:19 am

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

15 Bob May 23, 2009 at 10:00 pm

How many Blogs can I run on my computer.

16 Bill May 26, 2009 at 8:37 pm

@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.

17 Jan Will July 21, 2009 at 1:06 pm

Thanks so much! This post was really helpful !

18 Keith D July 25, 2009 at 8:43 am

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?

19 Frank Pezza October 23, 2009 at 2:53 pm

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.

20 Bill October 24, 2009 at 3:01 pm

@Frank: Were you able to run phpMyAdmin?

21 Keith Davis October 24, 2009 at 4:51 pm

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.

22 Bill October 26, 2009 at 7:02 am

@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?

23 Frank Pezza October 26, 2009 at 11:47 am

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.

24 Keith Davis October 26, 2009 at 12:42 pm

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.

25 Frank Pezza October 26, 2009 at 1:30 pm

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

26 Heather March 18, 2010 at 8:51 am

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!

27 Bill March 18, 2010 at 10:37 pm

@Heather: Wonderful to hear. Thanks.

28 Heather March 24, 2010 at 11:56 am

@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.

29 Heinrich April 19, 2010 at 5:11 pm

Thanks for the great article! I have set up my first local server with wordpress installed :)

30 irvan May 9, 2010 at 6:42 am

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

31 webeno May 16, 2010 at 3:00 pm

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

32 Abigail June 9, 2010 at 7:09 pm

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

33 Bill June 9, 2010 at 9:35 pm

@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?

34 Abigail June 11, 2010 at 6:04 am

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?

35 Abigail June 13, 2010 at 7:30 am

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?

36 Abigail June 13, 2010 at 12:17 pm

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.
Abigail recently posted..The Indigo & Co. Inc is currently underconstructionMy ComLuv Profile

37 classroomblog July 9, 2010 at 9:40 pm

Great guide. Setting up Wordpress on XAMPP to test some things out and your instructions made it easy. Appreciate it. Thanks.
classroomblog recently posted..Using Clickers in the ClassroomMy ComLuv Profile

38 alexwfix August 18, 2010 at 6:34 am

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.

Leave a Comment

CommentLuv Enabled

{ 7 trackbacks }

Previous post:

Next post: