Chapter 2 lab Chapter 3 lab Chapter 4 lab Chapter 5 lab Chapter 6 lab Chapter 7 lab Chapter 8 lab Chapter 9 lab Chapter 10 lab Chapter 12 lab Chapter 13 lab
Chapter 8 · Lab

Lab 8: Installing WAMP Server

Install and configure WampServer on Windows. This walkthrough is updated for a default WampServer 3.x (64-bit) installation, so the paths and settings match a standard setup.

Learning outcomes

  • Explain what WAMP is and what each letter stands for
  • Install WampServer using the default settings
  • Start and verify the Apache and MySQL services
  • Troubleshoot a port 80 conflict by changing the Apache port
  • Locate the webroot (document root) and deploy a PHP file
  • Find the three main configuration files
  • Access phpMyAdmin to manage databases

Your progress

Tasks completed 0/7

Log in to save your lab progress. Log in

1

Task 1 — Download & install WampServer

WAMP is a stack of programs that lets Windows run an HTTP server that understands PHP:

LetterStands for
WWindows — the operating system
AApache — the HTTP server
MMySQL / MariaDB — the database server and client
PPHP — a plugin for Apache so it can interpret PHP scripts
  1. Go to https://www.wampserver.com/en/ and download the 64-bit version (WampServer 3.3.x) for your Windows version.
  2. Run the installer as administrator.
  3. Accept the licence agreement and click Next through the setup wizard.
  4. Keep the default installation folder: C:\wamp64.
  5. On the SMTP/email screen, click Next (the defaults are fine).
  6. When asked for the default browser and text editor, choose your browser (e.g. Chrome/Edge) and editor (e.g. Notepad++/VS Code), or keep the defaults.
  7. Click Install, then Finish. WampServer starts automatically.

After installation a WampServer tray icon appears near the clock. Its colour tells you the status of the services.

2

Task 2 — Start the services and open localhost

The tray icon colour shows the service status:

  • Green — all services (Apache + MySQL) are running.
  • Orange — some services are running.
  • Red — no services are running.
  1. Left-click the tray icon and choose Start All Services (or Restart All Services).
  2. Wait until the icon turns green.
  3. Optional: right-click the tray icon and choose Put Online to let other devices on your network reach the server. Choose Put Offline to restrict access to your own computer.
  4. Open your browser and go to http://localhost/.
  5. You should see the WampServer welcome page. From its Tools menu you can also open phpMyAdmin and your www directory.
3

Task 3 — Troubleshoot a port 80 conflict

If http://localhost/ does not load, another program may already be using port 80 — common culprits are Skype, IIS, VMware, or another web server.

  1. Left-click the tray icon → Apache → httpd.conf.
  2. Search for Listen 80 and change it to Listen 8080.
  3. Also find ServerName localhost:80 and change it to ServerName localhost:8080.
  4. Save the file, then choose Restart All Services from the tray icon.
  5. Now open http://localhost:8080/.

Alternatively, close or uninstall the program occupying port 80. The tray icon → Apache → Test Port 80 option helps identify it.

4

Task 4 — The webroot (document root) directory

Where do your PHP files go? In a default WAMP installation the webroot (document root) is:

C:\wamp64\www

C:\wamp64\www maps to http://localhost/. For example:

C:\wamp64\www\project\script.php   →   http://localhost/project/script.php
  1. Open the tray icon → www directory (this opens C:\wamp64\www in File Explorer).
  2. Create a new folder called lab8.

You can change the webroot by editing DocumentRoot in httpd.conf (see Task 6).

5

Task 5 — Create and run your first PHP file

  1. In C:\wamp64\www\lab8\, create a file named hello.php with the code below.
  2. Open http://localhost/lab8/hello.php in your browser.
  3. You should see the output — the browser receives plain HTML from the server (the PHP code itself is never shown).
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>My first PHP page</title>
</head>
<body>
  <h1><?php echo "Hello from WAMP!"; ?></h1>
  <p>Today is <?php echo date("l, j F Y"); ?></p>
</body>
</html>
6

Task 6 — The three main configuration files

WAMP has three main configuration files:

FileConfiguresTypical location
httpd.confApache — webroot, listening port, etc.C:\wamp64\bin\apache\apache2.4.x\conf\
php.iniPHP — short tags, upload size, error reporting, etc.C:\wamp64\bin\php\php8.x\
my.iniMySQL / MariaDB — passwords, query buffers, cache, etc.C:\wamp64\bin\mysql\mysql8.x\

Open them quickly from the tray icon: Apache → httpd.conf, PHP → php.ini, MySQL → my.ini.

  1. Open httpd.conf and find DocumentRoot — this is where you would change the webroot.
  2. Open php.ini and find upload_max_filesize.
  3. Open my.ini and find the [mysqld] section.
7

Task 7 — Access phpMyAdmin (MySQL database)

phpMyAdmin is a web tool for managing your MySQL/MariaDB databases.

  1. Open http://localhost/phpmyadmin (or use the tray icon → phpMyAdmin).
  2. Log in with the default WAMP credentials — username root and an empty password (just click Go).
  3. Explore the list of databases on the left.
  4. Open the SQL tab and run: SELECT VERSION();

For a real project, set a password for the root user (or create a dedicated user) and update it in your PHP connection code.