WordPress in Windows

WAMP it into Shape: Installing WordPress Locally Under Windows

You can easily install WordPress locally on WindowsI’ve been working with WordPress in one way or another – personally and professionally – for several years now, but it’s only been in the past year or so that I began to feel the need to have a local installation. For the non-nerd reading this, that means having a Web server and database installed along with WordPress on my own computers – desktop and laptop – so I can work on and develop sites offline.

Whether creating a new WordPress Website or working on an existing one – say changing or modifying a theme, or trying out new plugins/developing your own – or developing some other sort of site or Web app that requires something more than simple html, it’s nice to be able to work locally, offline. This is especially true if you have an existing site that you don’t want to risk breaking. Of course you can create a subdomain of a live site for development and experimental purposes, but I find it’s easy to just do it locally then upload the files when whatever it is I’m working on is ready for the public eye.

Certainly this idea is nothing new to Web developers and programmers, and for the technically savvy, it’s rather simple to setup a local Web server and do this. But then there are many people blogging nowadays or otherwise using WordPress as a content management system for their or their employer’s Websites who probably still think of Native Americans if they here the word Apache, as opposed to Web server software. It wasn’t too long ago that I would have fallen into this latter category.

Thus it is with these people in mind – as much as for my own edification and future reference – that I take pen to paper (er, rather, keyboard to LibreOffice Writer) to help elucidate how to go about setting up and installing WordPress locally on your own computer. I’ve done this on both Windows XP and Windows 7, as well as Ubuntu. When I originally set about setting up WordPress locally, I found a lot of helpful information on various blogs, so you could say this is just my effort to pay it forward and add to the pool of DIY knowledge of Web nerdom and/or geekery out there on Teh Internets.

With that said, bear in mind that this is what works for me on my particularly hardware and software; it may or may not work for you, for a variety of reasons – no, this is not rocket science, but this is computer science. As such it can get wee bit complex.

WAMP! There It Is!

To work with WordPress locally, you need to set up a Web server on your computer, one that can accommodate MySQL database management and the PHP scripting language; these are two basic components of WordPress; this is what’s under the hood. Typically you’ll want to use Apache for your Web server; this free and open-source server software is pretty ubiquitous these days, and there are versions available for just about every operating system (OS) there is. The odds are your own Web host uses some version of it, and it gets along just fine with the software that WordPress uses.

Of course if you’ve used WordPress before, you’re probably familiar with some of the PHP files it incorporates, and have probably used phpMyAdmin, a Web-based user interface for MySQL.

WampServer 2: Apache, MySQL and PHP on WindowsYou could install Apache – or some other Web server software – MySQL and PHP individually on your Windows machine. Or you can opt for easy mode, and install it in one fell swoop, with WampServer 2. WAMP is an acronym for Windows, Apache, MySQL and PHP (or Perl or Python) – W-A-M-P. Because we can’t talk tech without an acronym.

But it’s no joke: WampServer 2 makes getting all this up and running on your Windows box almost ridiculously easy. There are other WAMP packages out there besides WampServer 2 (previously WAMP5) – XAMP is another one, for instance. Wikipedia has a nice comparison of the various WAMP packages out there; there are plenty of options. But WampServer is what I use, as I’ve had almost no trouble at all with it under both XP and Win7, and can vouch that it will work just fine with WordPress. A further bonus: it’s open-source software and free to use – although I’m sure it’s author, Romain Bourdon, would appreciate a donation via PayPal. Vive le Français!

You can learn more about WampServer — how to install it and how it works with Apache, PHP and MySQL — and there you can also download both 32-bit and 64-bit versions, depending on what version of Windows you are using. Currently I’m using the 64-bit version of WampServer 2.1 on Windows 7 Professional; I’ve also used WampServer 2.0 on my ancient XP laptop (which is now an Ubuntu laptop).

Step One: WampServer is Easy Mode for a Local WAMP Install

So download it, install it, and run it just like you would any other software package. You may notice during the installation, however, that WampServer’s default installation process doesn’t install to Windows’ usual Program Files directory. Left to its own devices, WampServer creates a root directory under Windows (C:wamp), where you’ll find a www subdirectory (think of it as your local Word Wide Web), among others (C:wampwww). It is here where your local WordPress install will reside. You can of course install WampServer and the related files and sub-directories/folders wherever you wish, but to keep things simple later on, I’d suggest sticking with this default setup.

WampServer is online in Windows -- as indicated by the system tray icon.When WampServer is running, you’ll see a little icon in the Windows system tray. In 2.1 on Win7, the tray icon is a stylized W; on 2.0 under XP it was a little analog dial. With this latest version it’s easy to tell if it’s offline or online; online it’s green; offline it’s red – green go, red stop. Simple enough, yeah?

An important thing to note: WampServer uses port 80 – or rather, Apache does — and this can sometimes conflict with other apps that also use this port, namely Skype. You can assign different ports for your various software – just make sure the ports you assign are not used by other apps. But if you want to keep it simple, just open WampServer first before you open Skype; Skype automatically chooses another port if port 80 is taken, and you can then run both Skype and WampServer happily at the same time.

If you launch WampServer and it can’t seem to get online within a few moments, it is probably some sort of port conflict; if you have Skype running it almost certainly is (speaking from personal experience here). Also note that WampServer must be online for you to access it locally – which you can do even if your computer itself is offline, i.e, not connected to the Internet.

You shouldn’t have any problems with Windows Firewall running WampServer; it automatically sets up an exception for the Apache server for local use during installation. Again, if you have trouble with it getting online, I would look for some sort of port conflict first. Of course if you run a third-party firewall, you may need to manually enable an exception for WampServer – or if you want to actually use the Web server for consumption out there on the Intertubes.

Step 2:
Verify Your Local Web Server is Up and Running — and Writable!

the WampServer 2 menu in WindowsSo, if you have WampServer up and running and online, we’re just about ready to start installing WordPress; there’s just one more thing to do and that’s make sure everything is copacetic with our install. Left click on the WampServer tray icon; you’ll be presented with a menu list – here you can start or stop WampServer, make changes to your Apache, MySQL and PHP configurations and navigate to your local directory where your Websites will reside.

In fact, if you click on the first option, “localhost,” you should see an information page open in your Web browser that provides details on your WampServer installation: the versions of Apache, MySQL and PHP it is using, configuration tools, links to the local directory and subdirectories, and so forth. This page you see is actually just a PHP file in your root directory (C:www) that WampServer creates during its installation. If you enter http://localhost/index.php in your browser when WampServer is running, you’ll see the same page; you can see an example from a screen cap at the bottom of this post.

Of course if you can see this page, then everything is hunky dory with WampServer. There’s just one more thing to do, but this is important, particularly for Windows 7 and Vista users. We need to make sure that WordPress has the rights to create, edit, and delete files in our www folder/directory. To do this:

  • Finding the Apache rewrite_module in WampServer 2right click on the WampServer tray icon to get the WampServer menu (pictured above)
  • right click on the Apache item to expand the submenu
  • right click on the Apache Modules item to expand that submenu (pictured to the right)

Now you should see a long list of modules that can be enabled in WampServer’s Apache configuration; you’ll probably have to scroll down to see the one we need to enable, the “rewrite_module.” Click it to enable it; if it has a check mark next to it – as in the image you see here – it’s enabled and you’re good to go.

Okay, we’re done tinkering with WampServer and ready to get rolling on that WordPress install. But this post is long enough; go here for the next step in this tutorial for installing WordPress under Windows.

The WampServer 2 landing page - index.php. If you can navigate to this, everything installed and is running correctly.

4 thoughts on “WordPress in Windows”

Leave a Reply

Your email address will not be published. Required fields are marked *