- Download PHP 8
- Extract PHP
- Rename and Configure php.ini
- Configure Apache to Use PHP
- Test PHP Installation
Download PHP 8
- Go to the official PHP website: https://windows.php.net/download
- Download the Thread Safe version (usually php-8.x.x-Win32-vs17-x64.zip for Apache 2.4).
Extract PHP
Extract the ZIP file to:
1 | D:\php-8.4.2-Win32-vs17-x64 |
Rename and Configure php.ini
Inside D:\php-8.4.2-Win32-vs17-x64
, rename php.ini-development
to php.ini
.
Open php.ini
in a text editor and configure the following:
Uncomment and modify important lines:
1 | extension_dir = "D:/php-8.4.2-Win32-vs17-x64/ext" |
Enable essential extensions:
1 | extension=curl |
Configure Apache to Use PHP
Locate and open the Apache config file, add the following lines at the end of the file:
1 | # PHP 8 Configuration |
Add index.php to the DirectoryIndex if not already there:
1 | DirectoryIndex index.php index.html |
Test PHP Installation
Create a test PHP file info.php
in your Apache htdocs
directory:
1 |
|
Restart Apache then open a browser and navigate to:
1 | http://localhost/info.php |