PHP powers WordPress, Laravel and a huge share of the web. Installing it on Windows 10 lets you run PHP scripts from the command line, test code locally, or pair it with a web server like Apache or IIS. PHP doesn’t come with a traditional installer on Windows. You download a ZIP file, extract it, and add it to your Path.
This guide covers the manual method, a one-line install with winget, how to set up php.ini, and how to run a quick test.
Before You Start
- Pick the right build. The official PHP for Windows site recommends 64-bit (x64) builds. Choose Non Thread Safe (NTS) for command-line use or IIS with FastCGI, and Thread Safe (TS) if you’ll load PHP as an Apache module.
- Install the Visual C++ Redistributable. Current PHP builds need the Microsoft Visual C++ Redistributable for Visual Studio 2015–2022 (x64). Many PCs already have it.
How to Install PHP on Windows 10
Step 1: Download PHP
Go to the official PHP for Windows downloads page and find the latest stable version (PHP 8.5 at the time of writing). Under VS17 x64 Non Thread Safe or VS17 x64 Thread Safe, click Zip.
Step 2: Extract the ZIP
Right-click the downloaded file, choose Extract All, and extract it to C:\php. A short path without spaces avoids problems with tools that call PHP.
Step 3: Add PHP to your Path
- Search Start for Edit the system environment variables and open it.
- Click Environment Variables.
- Under System variables, select Path and click Edit.
- Click New, type C:\php, and click OK on every window.
Step 4: Verify the install
Open a new Command Prompt window and type php -v. You should see the PHP version and build details. Old windows won’t see the updated Path, so always open a fresh one.
Step 5: Create php.ini
In C:\php, copy php.ini-development and rename the copy to php.ini. Use php.ini-production instead on a live server. Open php.ini in Notepad and:
- Uncomment
extension_dir = "ext"by removing the semicolon at the start of the line. - Uncomment extensions you need, such as
extension=curl,extension=mbstring,extension=opensslandextension=pdo_mysql. - Set your time zone, for example
date.timezone = America/New_York.
Run php -m to list the extensions that loaded.
Step 6: Test PHP
Create a file called test.php containing <?php phpinfo();. In Command Prompt, go to its folder and run php -S localhost:8000. Open http://localhost:8000/test.php in your browser to see a page of PHP configuration details. Press Ctrl + C to stop the built-in server.
Install PHP with winget
On Windows 10 with the App Installer from the Microsoft Store, you can install PHP from Command Prompt with winget. Run winget search PHP.PHP to see the available versions, then install one, for example winget install PHP.PHP.8.5. Winget adds PHP to your Path automatically, but you still need to create php.ini.
Use PHP with a Web Server
For local web development, many people pair PHP with Apache. Download the Thread Safe build, then follow how to install Apache in Windows 10 and load PHP as a module in httpd.conf. Bundles like XAMPP install Apache, PHP and MySQL together if you’d rather not configure each one.
Troubleshooting
- “php is not recognized as an internal or external command.” PHP isn’t on your Path, or you’re using a Command Prompt opened before you changed it. Recheck the Path entry and open a new window.
- “VCRUNTIME140.dll was not found.” Install the Visual C++ Redistributable for Visual Studio 2015–2022 (x64).
- An extension won’t load. Make sure extension_dir points to the ext folder and the DLL exists there. Run php -m to check.
- php -v shows an older version. Another PHP folder, often from XAMPP, is earlier in your Path. Move C:\php above it or remove the old entry.
- Composer can’t find openssl. Enable
extension=opensslin php.ini.
Frequently Asked Questions
What is PHP used for?
It’s a server-side language for building websites and web apps, including WordPress, Drupal and Laravel projects.
Can I run PHP without a web server?
Yes. Run scripts with php script.php, or use the built-in development server with php -S.
Is PHP free?
Yes. PHP is open source and free to use.
How do I update PHP?
Download the new ZIP, extract it over or next to the old folder, and copy your php.ini settings across. With winget, run winget upgrade.
Should I choose Thread Safe or Non Thread Safe?
Use Non Thread Safe for the command line and IIS, and Thread Safe for Apache’s module setup.
Wrapping Up
Download the x64 ZIP from windows.php.net, extract it to C:\php, add that folder to your Path, and create php.ini from the development template. Then run php -v to confirm it works. For full details, see the PHP manual for Windows installation.
Related: how to install SQLite on Windows 10.

Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.
His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.