Step 1: Download PHP
-
Go to the official PHP website: https://windows.php.net/download/
-
Under “Downloads”, choose the latest non-thread-safe x64 zip version (e.g.,
php-8.x.x-nts-Win32-vs16-x64.zip
). -
Save the ZIP file somewhere like
C:\php
.
Step 2: Extract PHP
-
Right-click the ZIP file → “Extract All”.
-
Extract to
C:\php
.
Step 3: Add PHP to System PATH
-
Press Win + S, type “Environment Variables”, and open the result.
-
Under System variables, select
Path
→ click Edit. -
Click New → add
C:\php
. -
Click OK to close all windows.
Step 4: Test PHP Installation
-
Open Command Prompt.
-
Type:
php -v
You should see the installed PHP version.
Step 5: (Optional) Configure php.ini
-
In
C:\php
, copyphp.ini-development
and rename it tophp.ini
. -
Open it in Notepad and enable/disable extensions as needed (e.g.,
extension=curl
).