Table of Contents
If you want to install PHP on Windows 11, you are in the right place. Whether you are building a local WordPress environment, testing a script, or setting up a full development stack, you can complete this entire setup in under 10 minutes. This guide will show you exactly how to install PHP on Windows 11 step-by-step to ensure a smooth development experience.

Prerequisites
Before you start, make sure you have:
- Windows 11 (64-bit) with administrator access
- Basic familiarity with opening Command Prompt
This guide walks you through installing PHP 8.x — the latest stable major version. Only choose PHP 7.4 if your legacy project specifically requires it.
Step 1: Download PHP to Install on Windows 11
Go to the official PHP downloads page at windows.php.net/download. Download the latest PHP 8.x Non-Thread Safe (NTS) ZIP for x64 Windows.
Thread Safe vs Non-Thread Safe — Which Should You Pick?
- Non-Thread Safe (NTS) — Choose this for CLI use and single-threaded servers. It works best for most local development setups.
- Thread Safe (TS) — Choose this only if you run Apache with its multi-threaded worker MPM.
When in doubt, pick NTS — it is the right choice for most Windows 11 setups.
Step 2: Extract and Place the PHP Folder
Extract the ZIP file you downloaded. Rename the folder to php and move it to the root of your C drive:
C:\php
Keep the path short and clean. A path like C:\php avoids spaces in directory names and saves you trouble in the next steps.
Step 3: Add PHP to Your Windows Environment Variables
You need to add PHP to your system PATH so you can run php commands from any terminal window. Here is how to do it:
- Press Win + S, search for Environment Variables, and open Edit the system environment variables.
- Click Environment Variables at the bottom of the dialog.
- Under System variables, select Path and click Edit.
- Click New and type
C:\php. - Click OK on all open dialogs to save your changes.
Verify Your PATH Update
Open a new Command Prompt window and run:
echo %PATH%
Check the output for C:\php. If you see it, you are ready to move on.
Step 4: Configure Your php.ini File
PHP includes two sample configuration files. You need to activate one before PHP can use it:
- Open
C:\phpin File Explorer. - Rename
php.ini-developmenttophp.ini.
Enable the Extensions You Need
Open php.ini in any text editor. Find the extensions section and remove the leading ; (semicolon) from these lines to enable them:
;extension=curl
;extension=mbstring
;extension=openssl
;extension=pdo_mysql
These four extensions power most PHP frameworks and WordPress. Enable them now to avoid issues later.
Step 5: Verify Your PHP Installation
Now that you install PHP on Windows 11, confirm everything works. Open Command Prompt and run:
php -v
You should see output similar to:
PHP 8.3.x (cli) (built: ...) (NTS)
If you see this, your PHP installation is working correctly. You are all set.
Troubleshooting Common Errors
- “php is not recognized” — You did not save the PATH correctly, or you are still using the old terminal window. Repeat Step 3 and open a fresh Command Prompt.
- Missing DLL error — You need to install the Visual C++ Redistributable that matches your PHP version.
Optional: Use XAMPP for an Easier Setup
If you also need Apache and MySQL alongside PHP, download XAMPP. It bundles all three tools into a one-click installer — you skip the manual PATH configuration entirely. The trade-off is that you get less control over individual component versions. If you are a complete beginner, XAMPP is a great starting point.
Conclusion
You now know exactly how to install PHP on Windows 11. You have added PHP to your system PATH and configured php.ini with the essential extensions. Your machine is ready for local PHP development.
Take the next step and build your first project: How to Create Your First PHP Project on Windows 11 →
Frequently Asked Questions
Which PHP version should you install on Windows 11?
Install the latest PHP 8.x stable release. You get better performance and modern language features out of the box. Only fall back to PHP 7.4 if your specific legacy application requires it.
Do you need a web server to run PHP on Windows?
No, you do not. You can run any PHP script directly from Command Prompt with php filename.php. For web development, start PHP’s built-in server with php -S localhost:8000 — no Apache needed.
Why does Windows not recognize the php command after installation?
You most likely did not save the PHP path to your system PATH variable, or you did not restart Command Prompt after making the change. Go back to Step 3, confirm C:\php is in the list, save, and open a fresh terminal window.
Can you run multiple PHP versions on the same Windows 11 machine?
Yes, you can. Place each version in its own folder — for example, C:\php8 and C:\php7. Switch between them by updating the PATH variable to point to whichever version you need.
