0
0
PhpHow-ToBeginner · 4 min read

How to Install WAMP for PHP Development on Windows

To install WAMP for PHP on Windows, download the WAMP server installer from the official website, run the installer, and follow the setup steps. After installation, start the WAMP server and verify PHP is working by accessing localhost in your browser.
📐

Syntax

WAMP is a software package that installs Windows, Apache web server, MySQL database, and PHP together. You don't write code to install it; instead, you run an installer program.

Key parts of the installation process:

  • Download: Get the WAMP installer from the official site.
  • Run Installer: Follow the setup wizard steps.
  • Start Server: Launch WAMP and ensure services run.
  • Verify: Open localhost in a browser to check PHP is working.
php
No code syntax applies as installation is done via installer GUI.
💻

Example

This example shows how to verify your WAMP installation works by creating a simple PHP file and opening it in your browser.

php
<?php
// Save this as info.php inside the www folder of WAMP
phpinfo();
?>
Output
A detailed PHP configuration page showing PHP version, modules, and settings.
⚠️

Common Pitfalls

  • Not running as Administrator: WAMP needs admin rights to start services.
  • Port 80 in use: Skype or other apps may block Apache's port 80.
  • Missing Visual C++ Redistributable: WAMP requires certain Microsoft libraries.
  • Wrong PHP file location: PHP files must be inside WAMP's www folder.
php
<?php
// Wrong: Placing PHP file outside www folder
// C:\Users\User\Desktop\test.php

// Right: Place PHP file inside www folder
// C:\wamp64\www\test.php
?>
📊

Quick Reference

  • Download WAMP from https://www.wampserver.com/en/
  • Run installer and follow prompts
  • Start WAMP server and wait for green icon
  • Place PHP files in www folder
  • Access PHP files via http://localhost/filename.php

Key Takeaways

Download WAMP from the official site and run the installer with admin rights.
Ensure no other app uses port 80 before starting WAMP server.
Place PHP files inside WAMP's www folder to run them.
Verify installation by creating a phpinfo() file and opening it in a browser.
Install required Visual C++ Redistributable packages if WAMP fails to start.