WAMP Local Development Environment Guide

Set up an Apache, MySQL, and PHP local environment on Windows using WAMP, and access your projects via localhost.


WAMP (Windows + Apache + MySQL + PHP) is one of the most commonly used PHP local development stacks on Windows. Once installed, you can run dynamic websites on your machine and access them in your browser via http://localhost.

What WAMP Includes

  • Apache: Web server responsible for responding to HTTP requests
  • MySQL / MariaDB: Relational database
  • PHP: Server-side scripting language

Some versions also come with phpMyAdmin for managing databases through the browser.

Installation and Startup

  1. Download and install from the WAMP official website (make sure to choose the 32/64-bit version that matches your system).
  2. After installation, the WAMP icon will appear in the system tray.
  3. A green icon indicates that both Apache and MySQL are running; an orange or red icon indicates that some services are not running properly.

Default Access Addresses

PurposeAddress
Site root directoryhttp://localhost
Alternative port (if 80 is occupied)http://localhost:8080
phpMyAdminhttp://localhost/phpmyadmin

Website files are typically placed in the www directory, for example:

C:\wamp64\www\myproject\

The corresponding access address would be http://localhost/myproject/.

Common Issues

Port 80 is Occupied
Skype, IIS, or other programs may occupy port 80. You can change the Apache listening port in the WAMP menu or close conflicting programs.

localhost Cannot Be Opened
Check if the WAMP icon is green; review the Apache/MySQL logs; ensure that the firewall is not blocking local services.

Page Displays PHP Source Code
This indicates that the PHP module has not loaded correctly. Try restarting all services or check in the WAMP menu if the PHP version is enabled.

Summary

WAMP is suitable for quickly setting up a PHP + MySQL environment on Windows. Place your project in the www directory, and use localhost for local debugging before deploying to a live server.

访客计数:------ Best viewed in Netscape Navigator · 800×600 © LocalHost Run