installphp.info


← Back to home page

Install PHP 7.1 on Server 2022

This version of PHP is actively supported.

Good news! PHP 7.1 is being actively supported through 20 Sep 2024. After that point, it's advisable to upgrade to the latest version, since the PHP team will only offer security-related support until 20 Sep 2024, at which point PHP 7.1 will be considered "end-of-life".

Installing PHP 7.1 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.1 from the official PHP website
  2. Extract the downloaded zip file to C:\PHP7.1
  3. Rename php.ini-production to php.ini
  4. Edit php.ini and set the extension_dir to "C:\PHP7.1\ext"
  5. Add C:\PHP7.1 to the system PATH environment variable
  6. Open IIS Manager and install the "CGI" feature if not already installed
  7. In IIS Manager, add a handler mapping for PHP
  8. Restart the IIS service

Verification

  1. Create a new file named phpinfo.php in the web root directory
  2. Add the following code to phpinfo.php:
    <?php phpinfo(); ?>
  3. Open a web browser and navigate to http://localhost/phpinfo.php
  4. Verify that the PHP information page is displayed, showing version 7.1
  5. Check that the loaded configuration file path is correct
  6. Ensure that required extensions are enabled