Note these are instructions for manually setting things up. If you want an automated installer, consider using XAMPP.
Sections:
Installing PHP 8.1 on Windows 10
This is for setting up PHP 8.1 to work with Apache.
Download the Correct Version (Apache 2.4 specific)
- Browse to https://windows.php.net/download#php-8.1
- Locate the thread safe (TS) 64-bit version. It will labeled VS16 x64 Thread Safe.
- Click on the Zip link under that section to download the file.
Extract
- Open the file in Windows explorer.
- Click Extract All.
- Set the "Files will be extracted to this folder" to C:\php
- Click Extract.
Configure
- Click the Search Icon. Type Command Prompt.
- Click on the Command Prompt program.
- In the Command Prompt window, type
copy C:\php\php.ini-development C:\php\php.ini
- Press enter.
- In the Command Prompt window, type
notepad C:\php\php.ini
- In Notepad search for the phrase
;extension_dir = "ext"
. Be sure that the search direction is set to down.
- Remove the semicolon
;
at the beginning of the line.
- If you are doing work with a MySQL database remove search for these lines and remove the semicolon
;
from the beginning of those lines.
Change
;extension=mysqli
;extension=pdo_mysql
to
extension=mysqli
extension=pdo_mysql
- Search for
;date.timezone =
- Remove the semicolon
;
from the beginning of the line to enable it.
- Browse to https://www.php.net/manual/en/timezones.php to see the list of supported timezones.
- Set the value of date.timezone to the timezone that you live in. For example, if you lived on the east coast of the United States, the timezone value would be
America/New_York
- Save the file.
- Close Notepad.