MW

How-To · Backend

How to Install PHP on Windows 10 / 11 (2026) — Manual, XAMPP, or WAMP

Three ways to get PHP on Windows: the manual install for full control, XAMPP for a complete LAMP-on-Windows stack, or WAMP for the Windows-native version. Pick one and you're done in 10 minutes.

Jan 24, 2025 6 min read Windows beginner
Advertisement

Installing PHP on Windows is the first step for WordPress development, Laravel projects, or anything PHP-driven. You have three credible paths — pick based on what else you need installed.

Command Prompt — after a successful install
C:\> php --version
PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15) (NTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.2.12, Copyright (c) Zend Technologies

Three installation methods

MethodBest forWhat you get
Manual installProduction-like setup, learning PHP adminPHP CLI + CGI, fully under your control
XAMPPLocal WordPress dev, cross-platform consistencyPHP + Apache + MySQL + phpMyAdmin in one installer
WAMPWindows-only dev, Windows-native feelSame stack as XAMPP, Windows-optimized

If you’re a WordPress dev: XAMPP is the default — it ships everything WP needs in one click. If you’re a Laravel/Composer dev who already has a database elsewhere: manual keeps things minimal.

Manual PHP installation

Step 1: Download

Visit windows.php.net/download and grab:

  • Latest PHP 8.2 or 8.3 (latest stable)
  • x64 Non-Thread-Safe zip (NTS — for CLI and most dev work)
  • Use Thread-Safe (TS) only if running PHP under Apache with mod_php

Step 2: Extract

Extract the zip to a simple path — C:\php is the convention:

Command Prompt — verify the extract
C:\> dir C:\php\php.exe
01/24/2026 09:15 AM 5,234,176 php.exe

Step 3: Add to PATH

Press Win + R , type sysdm.cpl, press Enter . Then AdvancedEnvironment Variables → edit System PathNew → paste C:\php.

Environment Variables
Variable
Value
ComSpec
C:\WINDOWS\system32\cmd.exe
OneDriveConsumer
C:\Users\mahesh\OneDrive
Path
C:\Windows\system32;C:\php
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.JS
TEMP
C:\Users\mahesh\AppData\Local\Temp

Step 4: Create php.ini

Copy php.ini-development to php.ini inside C:\php\:

Command Prompt — set up php.ini
C:\> copy C:\php\php.ini-development C:\php\php.ini
1 file(s) copied.

This enables PHP defaults appropriate for local dev. For production, use php.ini-production instead.

Step 5: Enable common extensions

Open C:\php\php.ini in any text editor and uncomment (remove the leading ;):

extension_dir = "ext"
extension=curl
extension=fileinfo
extension=gd
extension=intl
extension=mbstring
extension=mysqli
extension=openssl
extension=pdo_mysql

Save and verify in a new terminal:

Command Prompt — verify extensions loaded
C:\> php --version
PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15) (NTS Visual C++ 2019 x64)
C:\> php -m
[PHP Modules] Core curl date fileinfo gd intl json mbstring mysqli openssl pdo pdo_mysql Reflection SPL standard ...

Installation via XAMPP

The all-in-one approach — installs PHP, Apache, MySQL, phpMyAdmin in one wizard.

  1. Download from apachefriends.org
  2. Run the installer (default location is C:\xampp)
  3. Launch XAMPP Control Panel
  4. Click Start next to Apache (and MySQL if you want a database)
  5. PHP is now accessible — and its bin folder (C:\xampp\php) is auto-added to PATH

Verify in a new Command Prompt:

Command Prompt — XAMPP PHP
C:\> php --version
PHP 8.2.12 (cli) (built: Oct 24 2023 19:42:30) (NTS Visual C++ 2019 x64)

Installation via WAMP

WAMP is Windows-native and similar to XAMPP. Download from wampserver.com, install (default C:\wamp64), and start from the system tray. PHP lives at C:\wamp64\bin\php\phpX.X\php.exe.

Use WAMP when you want strictly Windows defaults and don’t need cross-platform consistency with team members on Mac/Linux.

Verify the installation

The canonical verification — three commands:

Command Prompt — full verification
C:\> php --version
PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15)
C:\> php -m | findstr mysqli
mysqli pdo_mysql
C:\> php -r "echo \"Hello from PHP \" . PHP_VERSION;"
Hello from PHP 8.2.12

Troubleshooting

”php is not recognized as an internal or external command”

PATH isn’t picking up your PHP install. Two fixes:

  1. Restart your terminal completely (close every window, open a new one)
  2. Verify the PATH entry is correct — see our full PATH fix guide

Extensions not loading

Check php.ini is in the right place:

Command Prompt — find loaded php.ini
C:\> php --ini
Configuration File (php.ini) Path: C:\Windows\ Loaded Configuration File: C:\php\php.ini Scan for additional .ini files in: (none)

If “Loaded Configuration File” is (none), your php.ini isn’t in C:\php\ — copy it from php.ini-development again.

Apache won’t start (XAMPP/WAMP)

Usually a port conflict — Skype, IIS, or Windows Web Deploy services use port 80. Either:

  1. Stop the conflicting service
  2. Change Apache’s port to 8080 in C:\xampp\apache\conf\httpd.conf

Best practices

  1. Use the latest stable PHP — security patches matter, and most WP/Laravel/Symfony versions target PHP 8.2+
  2. Pin extensions in php.ini — don’t rely on global defaults; explicitly enable what your code needs
  3. Separate dev and prod configs — keep php.ini-development settings locally, php.ini-production on the deployed server
  4. Document your local setup — write a 5-line README for your team listing PHP version + extensions + php.ini location
  5. Add to PATH at install time — every CLI tool will find PHP automatically

Conclusion

Installing PHP on Windows is a 10-minute job once you know the path:

  • Manual install for full control — C:\php\ + PATH + php.ini
  • XAMPP for one-click WP/Laravel setup with Apache and MySQL
  • WAMP for Windows-native dev preference

After install, php --version should print the version. From there, composer install, php artisan serve, or wp-cli all just work.

PHP Windows Installation Development Web Development
Advertisement

Get weekly notes in your inbox

Practical tips, tutorials and resources. No spam.