Download the Non-Threadsafe x64 (64-bit) version of PHP 8.1.12 (or latest version) from here https://windows.php.net/download#php-8.1
Unblock the Zip File (Properties - Clear Check Box - “This file came from another computer and is blocked . . . etc” Click OK.
Unzip the Zip File to php_8_1
Using Windows file explorer, copy and paste the contents of the “php_8_1” directory (that is, all files and subdirectories) to your new and separate PHP path, such as c:\php_8_1
Using Notepad++ or similar advanced text editor, in the root of the php_8_1 directory, find and open the file “php.ini-production” and save as a new file named “php.ini” without the quotes.
Here is a snapshot of the Windows PHP8 download page which also lists the other requirements such as the Visual C++ Redistributable that must be installed on the Windows server system.
Make Sure that you have installed on your Windows Server system the Visual Studio C++ Redistributable 2015-2019 X64 (or x86 32-bit as applicable). To Check, in the Windows search (bottom left of screen next to START), type “Control Panel” and Click the hit to open it, and then open “Programs and Features” and then on the left click the link for “Turn Windows Features on or off. Check from the resulting list whether VS C++ 2015-2019 x64 is installed.
At the Website level, in order to disable the particular version of PHP that you will not be using, you may be able to select the unwanted mapping and click remove at the right, or select the unwanted php version and select edit permissions and disable “script” access for the unwanted mapping.
Using Notepad++ or similar text editor, find and edit the php.ini file to enable extensions. Make sure that the applicable/corresponding php_*.dll file for the extension that you wish to activate is still available within the latest php8/ext/ directory
See the following screen snippet for examples of extensions to enable:
Use a file editor like Notepad++ to edit the php.ini file.
By default file uploads are enabled.
file_uploads = On
See the following screen snippet for examples of configuring php.ini for file uploads:
See the following screen snippet.