How to Install PHP 8.5 on Windows — Step-by-Step Guide for Beginners
In today’s Blog, I will guide you how to install PHP 8.5 on Windows step by step, even if you have never installed anything like this before.
By the end of this blog, you will have PHP fully installed, added to a system path, and you will be able to run PHP scripts through the command line.
If you are new here, consider subscribing. I post beginner-friendly developer tutorials every week.
Let’s jump into it!
Quick Roadmap
Here’s what we will do:
- Download PHP 8.5 for Windows
- Extract it from the right folder
- Configure the
php.inifile - Add PHP to our Windows PATH
- Test it in Command Prompt
Download PHP 8.5 for Windows
Open a link to windows.php.net/download.
This is the official Windows build site for PHP.
Scroll down until you see PHP 8.5.
Now you will notice two versions: Thread Safe and Non Thread Safe.
If you are not sure which to pick for beginner-friendly following along, go with Thread Safe x64. That’s the safest default for most local development setups.
Click the ZIP link.
Not the installer.
Not the debug pack.
Just the plain ZIP.
Let it download.
Extract PHP 8.5
Now let’s extract it.
I am going to create a folder directly on my C drive called PHP.
Now the path is simply:
C:\PHP
This keeps things clean and easy to reference later.
Click on the downloaded ZIP and select Extract All, then extract them straight into C.
Once it’s done, you should see files like php.exe and a couple of php.ini template files sitting right inside:
C:\PHP
Configure php.ini
Before PHP will run properly, we need a configuration file called php.ini.
Inside your PHP folder, you will see a php.ini-development file. This is a template.
Copy it and rename the copy to just:
php.ini
Open the file in Notepad or anything else.
We need to enable a few things first.
Search for extension_dir and remove the semicolon in front of it.
That semicolon means disabled, so removing it turns the line on.
Next, let’s enable a few common extensions most projects need:
- curl
- mbstring
- openssl
- fileinfo
Just delete the semicolon in front of each line.
Save the file when you are done.
Add PHP to Windows PATH
Now for the most important step: adding PHP to our system PATH.
This is what lets you type php in any Command Prompt window from any folder and have Windows know where to find it.
Click your Start menu and type:
environmental variable
Then click Edit the system environment variables.
In the window that pops up, click Environment Variables.
Under System Variables, find the one called Path.
Select it and click Edit.
Click New and type in:
C:\PHP
The exact folder where we extracted PHP earlier.
Click OK, OK, and OK again to close everything out.
Test PHP 8.5
Time for the moment of truth!
Open a brand-new Command Prompt window.
This part is very important.
Type:
php -v
and hit Enter.
If everything worked, you will see PHP 8.5 along with the build details right there in your terminal.
Run a PHP Script
Let’s do one more test.
I will create a simple PHP file that just echoes a message.
Save it and run it with:
php test.php
And there it is!
PHP 8.5 is working and printed on the console.
Conclusion
And that’s it!
PHP 8.5 is fully installed and running on your Windows machine.
In the next video, I will show you how to install and connect a local web server like Apache, or use PHP’s built-in server to actually view PHP pages in your browser.
So make sure you are subscribed for that.
If this video helped you, drop a like and leave a comment if you got stuck anywhere.
watch full video on youtube
