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.

  1. Download from laragon.org
  2. Run the installer → choose Full version
  3. Start Laragon → click Start All
  4. 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

2. Nginx

3. MySQL

4. Composer


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.

Leave a Reply

Your email address will not be published. Required fields are marked *