How To: Install WordPress on Windows

ADVERTISEMENT

When it comes to developing themes and plugins, you need the right tools to finish the job quickly and efficiently. There are a plethora of tools to choose from, and your selection can vary by personal taste. Some go for open-source tools like GIMP and Nvu, whereas others stick with trusted commercial applications like the omni-present Adobe Photoshop and Macromedia Dreamweaver. Whatever your choice maybe, it is essential that you like it and stick with it.

WordPress+XAMPP

Testing your themes and plugins can be a big head ache, as you have to reload the page every time, consuming bandwidth. Bandwidth is precious, unless you own a dedicated server at MediaTemple or something(!). Also, any edit has to be uploaded before previewing. This gets tiresome, and you would have wondered whether there is an easier way.

Linux users have the LAMPP(Linux, Apache, MySQL, PHP), which is easy, but Windows users are mostly unaware of a similar package. It is called XAMPP(Apache, MySQL, PHP). Once you install it, you can setup WordPress locally, and test your plugins/themes/hacks offline. You save bandwidth, effort and time.

Here are the steps for installing WordPress locally:

ADVERTISEMENT

  • Download the lite version of XAMPP, called XAMPPlite Choose the .exe version.
  • Install it at a partition of your choice. Here, we are using C drive.
  • Go to the install folder, that is C:xampplite. Double-click the xampp-control.exe file, and start up MySQL and Apache services in the dialog box that follows.
  • Go to http://localhost/ in your browser. From the left column, choose your language.
  • Click on phpMyAdmin in the left column(see image below).

    XAMPP screen

  • 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. XAMPP setup is now complete.
  • Download WordPress.
  • Unzip it to C:xampplitehtdocs
    You should have a wordpress folder in htdocs. Go to it, and open up wp-config-sample.php.
  • You will see a list of default values. Change them to below(do not copy-paste this, just find the required info and update the file):
    define('DB_NAME', 'wordpress'); // The name of the database
    define('DB_USER', 'root'); // Your MySQL username
    define('DB_PASSWORD', ''); // ...and password (needs to be empty, just for local install)

    Rename the file as wp-config.php and save it.

  • Go to http://localhost/wordpress/wp-admin/install.php in your browser, and follow the steps.

You’re done. Now, use the wordpress folder as you would on your webserver, and upload the plugins, themes etc. to test. I recommend doing this before attempting a manual install in your server ( if it doesn’t have one-click installer). Now, go and test to your heart’s content :D I am having a great time testing, and the instant page loads of my dummy blog looks great.

To get our latest articles, click here to sign up for our free email newsletter or subscribe to RSS feed

§ Comments
  • Shankar Ganesh says:

    Great tutorial man. I’ve already set this up on my local PC and loaded contents from my hosted blog on to this.. so I can get the exact environment I need when I’ve to test plugins :D

  • Linu says:

    I will try this…

  • Deepak says:

    You missed one step…
    You have to rename wp-config-sample.php to wp-config.php

    BTW, I think LAMPP and XAMPP are one and the same, except L is for Linux and X is for XP. :)

  • Sumesh says:

    @Shankar: Thanks. And yes, this is for newbies. I expect most of you to have this already.

    @Linu: Do try – it’ll make developing themes easier.

    @Deepak: Thanks. I guess, I forgot it. Am editing it now.

  • Haris says:

    Great tutorial! I don’t use XAMPP. I use NetServer, but still I have XAMPP in my PC in case I mess up with NetServer.

  • Sumesh says:

    @Haris: Thanks, and glad you liked it – I feel happy and believe it is worth the time spent, only when I get comments rolling.

  • Nirmal says:

    Nice tutorial, especially if you want to test themes and plugins locally before installing on server.

  • Andy says:

    Having trouble with establishing a connection with the database. After http://localhost/wordpress/wp-admin/install.php

    Have you missed out a step?
    define(’DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    I have set up WP on a live server before so I haven’t miscalulated my ability to edit the config file, so any ideas what is missing? Any help is appreaciated, as I’m setting this up to learn how to create themes!
    Cheers

  • Sumesh says:

    @Nirmal: Thanks, hope you’re having a blast using it :D

    @Andy: No, localhost(which corresponds to http://127.000.001/) is the local IP of your computer. It does not have to be changed, unless of course, you are using a live server. As for ideas, well, try again :D Maybe you missed a step.

  • Madhur Kapoor says:

    Great Tutorial Buddy . Currently i use EasyPHP for this purpose . It is a cool way to test your themes and plugins .

  • Myo Kyaw Htun says:

    I use Appserv. You can find installing wordpress on windows tutorial in my blog

  • MDB says:

    Wow! Never thought about or even realized that you could do this. What a great idea and well described. Will put it on my to do list after I have slimmed down all the junk on my hard drive.

  • Sumesh says:

    @Myo: I saw your tut, though its a bit long. For now, I prefer XAMPP.

    @MDB: Thanks, and glad that this tut could be of help.

    @Madhur: Thanks.

  • syahid ali says:

    if you want to do it the techie way (without xampp). check out my apache 2.2 installation guide

  • Sumesh says:

    @Syahid: Thanks for the link – I went through it. Its nice for show-off and ego boosting, but for now I find this method the easiest – easier than EasyPHP/direct method.

  • JoLynn Braley says:

    Great post, I’ve often wondered why more bloggers don’t install locally to do testing, theme modifications, etc. I use WAMP and my only problem is finding the time to do more work/testing on my local install so that I can change my live site! ;)

  • Sumesh says:

    @JoLynn: Yes, it is sensible to do testing in a local setup that is fast, and has no consequences when we mess it up. WAMP is cool – I read about installing it in a post by Ben Bleikamp(ProBlogger’s designer). As for not getting time, you’re not alone – count me in too!

  • Mitra says:

    Nice tut..Sumesh. I came across this one as I was looking for a more specific solution. I was able to do everything you have mentioned in the tut and wordpress was installed, up and running the first time. But once I shutdown the pc and restart it a while later, i was unable to logon via a login page i had bookmarked.

    I tried running the setup.bat once more and it kept saying:
    Sorry cannot find php.cli
    Must abort these process!

    When i open xampp_start: could not open default file – mysql\bin\my.cnf

    I am not sure whats wrong or how to fix it. Any pointers?

  • Sumesh says:

    @Mitra: That’s got me stumped. I’ve installed XAMPP+WP on two different computers, and nothing’s wrong. Are you sure you did not turn off any services?(Start>Run>msconfig, and click enter, you’ll get a window, click Services tab, and enable all services, restart and try again)

  • Monika @ The Writers Manifesto says:

    Hi Sumesh,

    I also wasn’t aware that we can do this. And here I am trying to mess around while online. Oh …the silly me. :-) Bookmarked and stumbled!

    Thank you

    Monika

  • Sumesh says:

    @Monika: Don’t mess around online, and especially not on your live blog. This method is much better, and many use it for theme/plugin development. And thanks for the stumble.

  • Monika @ The Writers Manifesto says:

    Hi Sumesh,

    I have gotten as far as installing everything as instructed. :-) It wasn’t as hard as expected as I’m no tech geek. But now I’m stuck. How can I upload new themes and stuff via FTP? I don’t know the path and the user and password I need to use here.

    I’m only familiar with FTP and have no idea on how to use mySQL to upload stuff. Could you please point me in the right direction? Once I can figure out the right path with FTP (I use SmartFTP) I will be fine.

    Thanks
    Monika

  • Sumesh says:

    @Monika: Its all easy, and you’d feel it funny that it has been under your nose all the while. Assuming that your wordpress folder is x(usually C)x:\xampplite\htdocs\wordpress\wp-content is the folder which contains plugins, themes and uploads folders. Then, just put the themes/plugins to their respective directories, like on the real server. No FTP, just Windows Explorer (or its Mac equivalent).

  • Monika @ The Writers Manifesto says:

    Duh…LOL, it does make sense now you mentioned it. Naturally it is all stored locally so it would be there. Oh man, sometimes I don’t see the trees in the forest.

    Thanks Sumesh ;-)

    Monika

  • Sumesh says:

    @Monika: Glad you got it, no prob =>

  • fazeetha says:

    hi sumesh,
    i don’t know abc’s of s/w…i just wanted to have a new theme for my blog in wordpress.
    i did everything mentioned here and was able to look at the theme that i wanted locally, but i don’t have any clue how to have that theme in my wordpress blog.
    can u please help me? i know i am dumb…hope u help me.

    thanks,
    fazeetha.

  • jojo says:

    Hello..
    I got an error…
    It says that Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the wordpress database.

    Anyone cah help me?

  • Lisa Irby says:

    Awesome instructions! I am so happy I can now test WP on my local machine now.

  • Rennie says:

    Read your tutorial and followed the steps. When inputting the link: http://localhost/wordpress/wp-admin/install.php all I get is a box with an error message “Error establishing a database connection and then a bunch of options of what it could be.
    I’ve been over the instructions with a fine tooth comb, xammp is running (I’m using the full version if that makes a difference), I can get into MySQL etc.etc.

    Any suggestions what the deal could be? Really appreciate your help.
    Thanks, Rennie

  • Sumesh says:

    @Rennie: The instructions here are for the smallest XAMPP package, that is XAMPPlite. Hence, these steps may not work for the full version of XAMPP.

  • Shane Swing says:

    Please allow me to share this video tutorial I created on how to Install WordPress Locally using Wamp with your audience.

    http://www.youtube.com/watch?v=biQWyBcYSX4
    Regards
    Shane

  • Afiliasi says:

    I have installed XAMP on my pc.
    Sometimes its take a long time until the sites is open.
    Would you tell why this happen?

    • Sumesh says:

      If you have external scripts (ads, for example) in the template, each page load would be delayed because of that.

  • Rits says:

    Hi All

    I see Sumesh is the geek here. I use wamp.
    Afiliasi, check your firewall settings – that is the no. 1 reason for slowing down. Allow all privileges.

  • WebTek says:

    Gd’ Day Bloggers… I have XAMPP installed and working with Wordpress on my company Intranet however I would like to streamline the URL for the users. I’d like for them to type http://bsd and have it resolve to the Wordpress installation without typing in anything else. I’ve tried changing/adding a Virtual Host in the appropriate “conf” file with no luck, I still have to type http://bsd/wordpress to resolve to the site. ANy suggestions on how to fix this? Thanks in Advance.

    • Sumesh P says:

      If you have got http://bsd/wordpress working, then you only have to move the WordPress files to the root (instead of in a folder called wordpress/) to get it running the way you want.

  • mark says:

    Hi,

    I’m getting an ‘Object not found’ error when i go to “http://localhost/wordpress/wp-admin/install.php”.

    I’m not sure why this is happening because I’m able to load the XAMPP (http://localhost/xampp/) page without a problem.

    Can anyone help?

    Thanks,
    Mark

  • mark says:

    Hey guys,

    I was able to figure out the problem. Uninstall Wordpress to C:\xampplite\htdocs <— there is a typo in the instructions.

    Thanks!

    Mark

  • § Leave a Reply