installphp.info


← Back to home page

Install PHP 7.2 on Server 2022

Warning! This PHP version is end-of-life!

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

  1. Download PHP 7.2 from the official PHP website
  2. Extract the downloaded ZIP file to C:\PHP7.2
  3. Rename php.ini-production to php.ini
  4. Edit php.ini and set the extension_dir to "C:\PHP7.2\ext"
  5. Add C:\PHP7.2 to the system PATH environment variable
  6. Open IIS Manager and install URL Rewrite Module
  7. In IIS Manager, add a handler mapping for PHP
  8. Restart IIS

Verification

  1. Open Command Prompt and type "php -v" to check the installed version
  2. Create a test PHP file (e.g., info.php) with the following content:
    <?php phpinfo(); ?>
  3. Save the file in the web root directory (usually C:\inetpub\wwwroot)
  4. Open a web browser and navigate to http://localhost/info.php
  5. If PHP is installed correctly, you should see the PHP information page