How to install Drupal 7 on WAMP

Introduction

This article will explain how to set up Drupal 7 on WAMP, for windows. WAMP is a software package that installs Apache, Mysql and PHP at once and also offers an easy management interface. It also installs PHPMyAdmin, sqlbuddy and webgrind. An alternative to WAMP is XAMPP which I haven't tried yet but does much the same kind of thing. XAMPP has a portable version for running USB sticks which looks quite interesting.

Once we're done, you'll have a Drupal 7 install running under http://localhost/d7

Step 1. install WAMP

Head on over to the WAMP download page and choose an install package. I chose a 32 bit version running PHP 5.3 and Apache 2.2. I would steer clear of PHP 5.4 for now as I am not sure how 'PHP 5.4 ready' Drupal 7 or the contrib modules are.
medium_wamp.png

Before you install WAMP download and install the c++ redistributable package from Microsoft, the WAMP page will give you instructions. Install the C++ redistributable package first..
medium_wamp_cplusplus.png

Then install WAMP..
medium_wamp_install_start.png

Once done, assuming WAMP isn't running already, start it and look at http://localhost in your web browser, you should see this:
medium_wamp_working.png

in the icon notification section you should see this:
wamp_running.png

If the icon is orange, rather than green there WAMP couldn't start normally. I have experienced this twice, the first time it was a port conflict with Skype, the second time was simply that I hadn't installed the c++ redistributable properly. If WAMP isn't starting the first thing to check is a port conflict on port 80, check this from here by clicking on 'Test port 80'.

service_test.png

If skype is using that port, the simplest thing would be to make Apache listen to port 81, open the httpd.conf from here:

httpdconf.png

Then change:

Listen 80

to

Listen 81

and restart apache.

Here is a good page on fixing WAMP start problems.

Step 2. Enable Mod rewrite

Drupal can have nice clean URLs without ?q=xxx but you need to have Apache Mod Rewrite running. From the WAMP icon in the start bar enable this:
medium_enable_mod_rewrite.png

Step 3. Set up a Drupal 7 database

From PHPMyAdmin go to the SQL tab which should look like this:
medium_phpmyadmin_create_db.png
and enter the command:

CREATE database d7;

Step 4. Create a Drupal 7 db user

Again from the SQL tab, enter these commands one by one, the username and password can be anything you like but you need to keep a note of them for later.

CREATE USER "d7" IDENTIFIED BY "d7pass";
 
GRANT ALL PRIVILEGES ON d7.* TO 'd7'@'localhost' IDENTIFIED BY 'd7pass';
 
flush privileges;

Step 5. Download Drupal 7

Head on over to the Drupal site and download the latest 7.x version of Drupal. Extract it to the WAMP apps folder which should be:

C:\wamp\www

so then you'll see this:
medium_drush1.png
then rename the Drupal folder to d7. You could leave as it is, it'll just make for an ugly URL that's all. I consciously just added a directory inside www to make it easier to add new sites, just create new directories for other sites as you wish.

Step 6. Install Drupal

Ideally there would be a mail server running, which is cinch to set up on linux but I'm skipping that for now with this windows install, and we'll make do without. Choose the standard install rather than minimal.

Go to the drupal install page which will be http://localhost/d7/install.php which should look like this:
medium_d7_install_start_screen.png

Enter your details, using the database settings you set up previously. The site email address is where users will appear to get mails from the Drupal 7, just enter anything and be careful about entering the user details. noreply@localhosthd7.com doesn't actually work but I needed to add some kind of mail address to prevent Drupal throwing a mail validation error. Remember this is only what will appear in the 'From' part of mails. I usually name the first user 'admin'.
medium_d7_install_final_step.png

Submit the form, wait a few seconds and Drupal should be installed, you can now view it and log in with the account you created.
medium_d7_working.png

Step 7. Enable clean URLS

Assuming you enabled Mod Rewrite, it's time to make Drupal use clean urls. Go to:

Configuration > Clean urls
then check Enable clean urls

Final tip

The log in page is:
http://localhost/d7/user/login

Where to go from here

Be you non-techie, designer or developer, if you are completely new to Drupal I would explore the Drupal.org documentation section and I can highly recommend the book Using Drupal. If you are designer, try out some themes, and get into theme development. Starter themes will help you get going, you won't need to totally reinvent the wheel.

Developers I will cover in further tutorials on more technical topics such as Drush and module development. If you encounter any problem s, post a comment.

Blog tags: