set up a local web development environment on Windows 11
Here’s how to set up a local web development environment on Windows 11:
Option A: Use Laragon (Recommended for Windows)
The easiest approach. Laragon bundles Nginx, PHP, MySQL, and Composer in one installer.
- Download from laragon.org
- Run the installer → choose Full version
- Start Laragon → click Start All
- Everything runs automatically — Nginx, MySQL, PHP, and Composer are ready
✅ Auto virtual hosts, easy PHP version switching, no manual config needed.
Option B: Manual Installation
1. PHP
- Download from windows.php.net/download → get the Thread Safe ZIP (x64)
- Extract to
C:\php - Add
C:\phpto your System Environment PATH - Copy
php.ini-development→ rename tophp.ini - Open
php.iniand uncomment these extensions:extension=curlextension=mbstringextension=opensslextension=pdo_mysqlextension=fileinfo
2. Nginx
- Download from nginx.org/en/download.html → Stable version ZIP
- Extract to
C:\nginx - Start it: open CMD in
C:\nginxand runnginx.exe - Test at
http://localhost
3. MySQL
- Download MySQL Installer from dev.mysql.com/downloads/installer
- Run installer → choose Developer Default or Server Only
- Follow setup wizard, set a root password
- Optionally install MySQL Workbench for a GUI
4. Composer
- Download installer from getcomposer.org/download
- Run
Composer-Setup.exe→ it auto-detects PHP - Verify: open a new CMD and run
composer --version
Connecting Nginx to PHP (Manual setup only)
Edit C:\nginx\conf\nginx.conf — find the PHP location block and update it:
location ~ \.php$ {
root C:/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_name;
include fastcgi_params;
}
Then start PHP-FPM in a separate CMD window:
php-cgi -b 127.0.0.1:9000
Verify Everything Works
php --version # PHP version
nginx -v # Nginx version
mysql --version # MySQL version
composer --version # Composer version
💡 Recommendation
If you’re building a Laravel or WordPress app, go with Laragon — it saves hours of config and handles virtual hosts automatically. Manual setup is better if you need precise control over versions or server config.
