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.
Three installation methods
| Method | Best for | What you get |
|---|---|---|
| Manual install | Production-like setup, learning PHP admin | PHP CLI + CGI, fully under your control |
| XAMPP | Local WordPress dev, cross-platform consistency | PHP + Apache + MySQL + phpMyAdmin in one installer |
| WAMP | Windows-only dev, Windows-native feel | Same 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:
Step 3: Add to PATH
Press Win + R , type sysdm.cpl, press Enter . Then Advanced → Environment Variables → edit System Path → New → paste C:\php.
Step 4: Create php.ini
Copy php.ini-development to php.ini inside C:\php\:
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:
Installation via XAMPP
The all-in-one approach — installs PHP, Apache, MySQL, phpMyAdmin in one wizard.
- Download from apachefriends.org
- Run the installer (default location is
C:\xampp) - Launch XAMPP Control Panel
- Click Start next to Apache (and MySQL if you want a database)
- PHP is now accessible — and its bin folder (
C:\xampp\php) is auto-added to PATH
Verify in a new Command Prompt:
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:
Troubleshooting
”php is not recognized as an internal or external command”
PATH isn’t picking up your PHP install. Two fixes:
- Restart your terminal completely (close every window, open a new one)
- Verify the PATH entry is correct — see our full PATH fix guide
Extensions not loading
Check php.ini is in the right place:
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:
- Stop the conflicting service
- Change Apache’s port to 8080 in
C:\xampp\apache\conf\httpd.conf
Best practices
- Use the latest stable PHP — security patches matter, and most WP/Laravel/Symfony versions target PHP 8.2+
- Pin extensions in
php.ini— don’t rely on global defaults; explicitly enable what your code needs - Separate dev and prod configs — keep
php.ini-developmentsettings locally,php.ini-productionon the deployed server - Document your local setup — write a 5-line README for your team listing PHP version + extensions + php.ini location
- 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.