How to install and configure WAMP Server for PHP Development


WAMP Server is an all-in-one software package for Windows. It includes all tools required for PHP development- PHP, MySQL and Apache. Take a look at how to install and configure WAMP server on a Windows machine.

What is WAMP Server


WAMP Server is a Windows-based web development environment that allows you to develop web applications using PHP and MySQL. It is basically an all-in-one software package that includes all tools required for PHP development - PHP, MySQL and Apache. Apart from this, it also includes PhpMyAdmin- a visual interface for managing databases.

Installing WAMP Server


Step 1 : Go to http://www.wampserver.com/en/ and click on the 'Download' option on the page.

Step 2 : Choose an appropriate option for your version of Windows (32 or 64-bit) and the version of the tools you need. Download and run the installer. While installing, the software will ask you to specify the default browser and choose a host name. The host name can be left as the default 'localhost'. If you get a firewall warning for Apache, then click on 'Unblock' or 'Grant Access'.

Configuring WAMP Server


Once the WAMP Server gets installed and starts running, its icon will appear in the system tray. Depending on the configuration, the icon is color coded in the following way:

Red : A red icon indicates that no services are running on the system.

Orange : An orange icon indicates that only some of the services are running on the system.

Green : A green icon indicates all services are running on the system and that WAMP Server is properly configured.

If the WAMP Server icon on your system tray is orange, then most probably it is an issue with Apache service. This can be verified by clicking on the WAMP Server icon and then by going to Apache. Go to 'Service' option. If the 'Start Service' option is available then the Apache service is not running.

Configuring the Apache service


Apache commonly uses port 80 for web services and if this port is already being used by the system, then Apache will not start. Usually, port 80 on Windows systems is either used by Skype or IIS (Windows based Web Server). The port can be freed for Apache in the following way:

Step 1 : If you are using Skype, then go to Tools -> Options -> Advanced -> Connection. Here un-check the option 'Use port 80 and 443 as alternatives for incoming connections'.

Step 2 : Go to Control Panel -> Programs and Features (To open the Add/Remove Programs window) -> Turn Windows Features On or Off. Check if the box next to 'Internet Information Services' is checked or filled. Most probably it will be filled. So, clear the box and click on OK. Wait while Windows does its thing and then restart the system if required. This will remove the IIS service from the system.

Now, when you start WAMP Server, the icon should turn green. This would indicate that all services are running correctly. To further verify, you can open your browser and type http://localhost/ in the address bar. You should see a page like this:

WAMP Server Home Page

If you see this page, it means that all is well. You can click on the phpmyadmin option here to view the database management interface and also on phpinfo() to view detailed information on the PHP version installed on your system.

After this, we are left with only a couple of configuration steps which are outlined below.

Step 1 (Configuring PHP) : Click on the WAMP Server icon in the system tray and go to PHP -> PHP Settings and make sure that there is a check next to 'Display Errors' and 'Log Errors'. Go back to PHP and click on 'php.ini'. The file will open up in Notepad. Scroll down till you see a section called 'Error handling and logging'. In that section, look for a value called 'error_reporting'. This should be set to 'E_ALL' only. Save and close the file.

Step 2 (Configuring MySQL) : Click on the WAMP server icon again and go to MySQL -> MySql Console. A command prompt window will open and ask for password. Press 'Enter' and this will take you to the mysql> prompt. At this prompt, do the following:

1. Type 'use mysql' and press 'Enter'. It will respond with a 'Database changed' message.
2. Type 'UPDATE user' and press 'Enter'.
3. Type 'SET Password=PASSWORD('Your Password Here')' and press 'Enter'.
4. Type 'WHERE user=root;' and press 'Enter' (Please note the semi-colon at the end of the statement).
5. Type 'FLUSH PRIVILEGES;' and press 'Enter' (Please note the semi-colon at the end of the statement).
6. Type 'quit' and press 'Enter' to close the MySql console.

Step 3 (Configuring PhpMyAdmin) : Open the folder in which you installed WAMP on your system. This is by default C:/wamp. Then go to apps -> phpmyadmin and here, look for a file called 'config.inc.php'. Open it for editing (either in notepad or in any editor of your choice). Look for the entry that says "$cfg['Servers'][$i]['password'] = ''" and enter the password you just specified above in the single quotes. Then, just below this, you should see an entry as "$cfg['Servers'][$i]['AllowNoPassword'] = 'true'. Change 'true' to 'false', save and close the file.

Click back on the WAMP Server icon in the tray and click on 'Stop all services'. The icon should turn red. Then click on 'Start all services'. Wait for a few seconds till the icon turns green.

And that's it. You are all set for PHP development on your system. Happy Coding!

Read Set up your own web server using WAMP


Comments

Guest Author: Krithika11 Jun 2014

I want to learn PHP to start a small web development company. How long it will take to learn PHP to develop my own websites? Can I learn PHP without going for any training? Please guide me how to proceed. I am very new to web development.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: