Skip to main content
Being Idea Innovations
Install WAMP Server on Windows: Setup, Common Errors and Alternatives
Back to Blog

Install WAMP Server on Windows: Setup, Common Errors and Alternatives

3 August 20186 min readApache
Share:

WAMP bundles Apache, MySQL and PHP into a single Windows installer, giving you a local server without configuring three separate services. The installation is usually quick — and when it goes wrong, it goes wrong in the same two or three ways every time.

Before you install: the Visual C++ redistributables

This is the single most common cause of a failed WAMP installation, and the installer's own warning about it is easy to miss.

Apache and PHP on Windows are compiled with Microsoft's C++ compiler and need the matching runtime libraries. Without them the tray icon stays red or orange forever, or you get an error about MSVCR110.dll being missing.

Install all the redistributables before running the WAMP installer — VC++ 2008, 2010, 2012, 2013 and 2015–2022, in both x86 and x64. The WampServer site links a bundled package that installs the lot. Do this first and most installation problems never occur.

Installing

  1. Download the 64-bit installer from wampserver.com unless you are on 32-bit Windows.
  2. Install to C:\wamp64, not Program Files. Paths with spaces and Windows' permission model on Program Files both cause problems. Accept the default.
  3. When asked for a default browser and text editor, it wants an .exe — point it at your editor or just accept Notepad. It has no effect on how the server runs.
  4. Launch from the Start menu. A tray icon appears.

What the tray icon colour means

ColourMeaningUsual cause
GreenApache and MySQL both running
OrangeOne service running, the other notPort conflict, or MySQL failed to start
RedNeither runningMissing VC++ runtimes, or port 80 taken

Once green, open http://localhost/ — you should see the WAMP homepage. phpMyAdmin lives at http://localhost/phpmyadmin.

Fixing the orange icon: port conflicts

Apache needs port 80 and something else usually has it. Find out what:

netstat -ano | findstr :80

Take the PID from the last column and look it up in Task Manager's Details tab. The usual culprits:

  • IIS — Windows' own web server. Disable "World Wide Web Publishing Service" in Services, or turn IIS off in "Turn Windows features on or off".
  • Windows' HTTP service (System, PID 4) — often SQL Server Reporting Services or the Print Spooler's web component.
  • VMware, Skype (older versions), or another AMP stack already running.

If you cannot free port 80, move Apache instead. Left-click the tray icon → Apache → httpd.conf, and change:

Listen 8080
ServerName localhost:8080

Your site is then at http://localhost:8080/. Restart all services afterwards.

For MySQL failing to start, check C:\wamp64\logs\mysql.log. The common cause is another MySQL already installed as a Windows service holding port 3306 — either stop that service or change WAMP's port in my.ini.

Your first project

Everything served lives under C:\wamp64\www. Create a folder there:

C:\wamp64\www\myproject\index.php
<?php
declare(strict_types=1);

echo 'Welcome — PHP ' . PHP_VERSION . ' is running.';

Open http://localhost/myproject/. The URL path always mirrors the folder name under www — if you created myproject, the URL is /myproject/, not anything else.

WAMP also lists every folder in www under "Your Projects" on the localhost homepage, which saves typing.

Switching PHP version

A genuine advantage of WAMP over some alternatives: left-click the tray icon → PHP → Version, and pick from any installed version. Useful when one client's site needs PHP 7.4 and another needs 8.3. Add more versions from the WampServer add-ons page.

Creating a database

Open phpMyAdmin at http://localhost/phpmyadmin. The default credentials are username root with an empty password.

Run this in the SQL tab:

CREATE DATABASE shop_demo
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_0900_ai_ci;

USE shop_demo;

CREATE TABLE products (
  id          INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  name        VARCHAR(150)   NOT NULL,
  price       DECIMAL(10,2)  NOT NULL,
  description TEXT           NULL,
  created_at  DATETIME       NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at  DATETIME       NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;

Two things worth doing from the start. Specify utf8mb4 explicitly — older MySQL defaults to latin1, which cannot store emoji or most non-Western scripts, and converting later is tedious. And use DECIMAL for money, never FLOAT, which cannot represent most decimal values exactly.

Connecting from PHP

Keep credentials in one file:

<?php
// config.php
return [
    'host' => 'localhost',
    'db'   => 'shop_demo',
    'user' => 'root',
    'pass' => '',          // WAMP's default — see the security note below
];
<?php
// db.php
declare(strict_types=1);

$config = require __DIR__ . '/config.php';

try {
    $pdo = new PDO(
        "mysql:host={$config['host']};dbname={$config['db']};charset=utf8mb4",
        $config['user'],
        $config['pass'],
        [
            PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES   => false,   // use real prepared statements
        ]
    );
} catch (PDOException $e) {
    // Log the detail; never print it to the browser in production.
    error_log($e->getMessage());
    exit('Database connection failed.');
}

Use PDO rather than the mysql_* functions you will find in older tutorials — those were removed in PHP 7 and do not exist any more.

Security: WAMP is a development tool

Out of the box WAMP has root with no password and phpMyAdmin open to anyone who can reach it. That is fine on a laptop and dangerous anywhere else.

  • Never expose WAMP to the internet. It is not hardened for it. Use real hosting for anything public.
  • Set a root password if you are on a shared or office network. phpMyAdmin → User accounts → root → Change password, then update config.inc.php so phpMyAdmin can still connect.
  • Keep "Put Online" off unless you specifically need another device on your network to reach it. That setting changes Apache's access rules from localhost-only to open.

Should you use WAMP at all?

It still works, but there are now better options depending on what you are doing:

ToolStrengthBest for
WAMPEasy PHP version switchingClassic PHP and WordPress work on Windows
XAMPPCross-platform, bundles Mercury and FileZillaTeaching, matching a course
LaragonAutomatic virtual hosts, faster, portableMost modern Windows PHP work
DockerEnvironment matches production exactlyTeams, anything deployed to Linux
WSL2Real Linux under WindowsClosest match to a Linux server

The honest recommendation: if you are learning PHP on Windows, WAMP or Laragon will get you going in ten minutes and that has real value. If you are building something that will deploy to a Linux server, Docker or WSL2 saves you the class of bug where code works locally and fails in production because Windows filesystems are case-insensitive and Linux ones are not.

Common problems

SymptomFix
Icon stays redInstall every VC++ redistributable, then reinstall
Icon stays orangePort 80 or 3306 in use — check with netstat
"Forbidden" on localhostLeft-click tray → Put Online, or check Require local in httpd.conf
PHP code shows as textFile saved as .html, or Apache started before PHP loaded
phpMyAdmin "access denied"Root password changed but config.inc.php not updated
Changes to php.ini ignoredEdit through the tray menu, not the file directly — WAMP keeps several copies

That last one catches almost everyone. WAMP maintains a separate php.ini per PHP version, and editing the wrong one has no effect. Always go through the tray icon → PHP → php.ini.

Share:

Written by

Amit Verma

Founder / Senior Software Engineer

Amit leads engineering at Being Idea. With 15+ years building scalable software products across global markets, he drives architecture decisions and engineering culture across every engagement.

More articles by Amit

Want to talk tech?

We ship software that scales. Let's work together.

No long-term contracts
Senior engineers only
US · AU · NZ timezone coverage
14-day trial on retainers