WAMPApachePHP7 min read

Install WAMP (Apache + MySQL + PHP)

Install WAMP on Windows Server for a complete web environment with Apache, MySQL, and PHP.


WAMP gives you a complete web environment on Windows with Apache, MySQL, and PHP preconfigured.

Option 1 — Install WampServer

Download WampServer from wampserver.com:

powershell
# Download Visual C++ Redistributable (requirement)
Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "C:\temp\vcredist.exe"
C:\temp\vcredist.exe /install /quiet /norestart

After installing WampServer, services are located at:

  • Apache: C:\wamp64\bin\apache\
  • PHP: C:\wamp64\bin\php\
  • MySQL: C:\wamp64\bin\mysql\
  • Websites: C:\wamp64\www\

Option 2 — Manual installation (more control)

Step 1 — Install Apache

powershell
# Download Apache
Invoke-WebRequest -Uri "https://www.apachelounge.com/download/VS17/binaries/httpd-2.4.59-240605-win64-VS17.zip" -OutFile "C:\temp\apache.zip"
Expand-Archive -Path "C:\temp\apache.zip" -DestinationPath "C:\"

# Install as service
C:\Apache24\bin\httpd.exe -k install
Start-Service Apache2.4

Step 2 — Install MySQL

powershell
# Download MySQL Community
Invoke-WebRequest -Uri "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.37-winx64.zip" -OutFile "C:\temp\mysql.zip"
Expand-Archive -Path "C:\temp\mysql.zip" -DestinationPath "C:\"
Rename-Item "C:\mysql-8.0.37-winx64" "C:\MySQL"

# Initialize
C:\MySQL\bin\mysqld.exe --initialize-insecure --basedir=C:\MySQL --datadir=C:\MySQL\data

# Install as service
C:\MySQL\bin\mysqld.exe --install
Start-Service MySQL

# Set root password
C:\MySQL\bin\mysql.exe -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'SecurePassword123!';"

Step 3 — Install PHP

Follow the steps from the "Install PHP on IIS" guide but configure Apache instead of IIS.

In C:\Apache24\conf\httpd.conf add:

apache
LoadModule php_module "C:/PHP/php8apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "C:/PHP"

Step 4 — Verify

Create C:\Apache24\htdocs\info.php:

php
<?php phpinfo();

Access http://YOUR_IP/info.php.

Step 5 — Configure firewall

powershell
New-NetFirewallRule -DisplayName "Apache HTTP" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
New-NetFirewallRule -DisplayName "Apache HTTPS" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow

Service management

powershell
# Restart Apache
Restart-Service Apache2.4

# Restart MySQL
Restart-Service MySQL

# View status
Get-Service Apache2.4, MySQL | Format-Table Name, Status

WAMP on your Baires Host Windows VPS gives you a complete web environment ready for production or development.


Was this guide helpful?