PHP 7.2 reached end of life on 30 Nov 2020 and is no longer being updated. It's strongly recommended to upgrade to the latest version as soon as possible. You can read the official PHP migration guide here.
Installing PHP 7.2 on Server 2022
Prerequisites
Windows Server 2022 installed and updated
Administrative access to the server
Internet connection for downloading PHP
IIS (Internet Information Services) role installed
Installation
Download PHP 7.2 from the official PHP website
Extract the downloaded ZIP file to C:\PHP7.2
Rename php.ini-production to php.ini
Edit php.ini and set the extension_dir to "C:\PHP7.2\ext"
Add C:\PHP7.2 to the system PATH environment variable
Open IIS Manager and install URL Rewrite Module
In IIS Manager, add a handler mapping for PHP
Restart IIS
Verification
Open Command Prompt and type "php -v" to check the installed version
Create a test PHP file (e.g., info.php) with the following content:
<?php phpinfo(); ?>
Save the file in the web root directory (usually C:\inetpub\wwwroot)
Open a web browser and navigate to http://localhost/info.php
If PHP is installed correctly, you should see the PHP information page