installphp.info


← Back to home page

Install PHP 7.2 on Server 2019

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 2019

Prerequisites

  • Windows Server 2019 installed and up to date
  • 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 a directory (e.g., C:\PHP7.2)
  3. Copy php.ini-production to php.ini in the same directory
  4. Open IIS Manager and navigate to the server node
  5. Open "Handler Mappings"
  6. Click "Add Module Mapping" in the Actions pane
  7. Set the following values:
    • Request path: *.php
    • Module: FastCgiModule
    • Executable: C:\PHP7.2\php-cgi.exe
    • Name: PHP 7.2
  8. Click "OK" and then "Yes" to create a FastCGI application
  9. Add C:\PHP7.2 to the system's PATH environment variable
  10. Restart the IIS service

Verification

  1. Create a new file named phpinfo.php in your web root directory (usually C:\inetpub\wwwroot)
  2. Add the following content to phpinfo.php:
    <?php phpinfo(); ?>
  3. Open a web browser and navigate to http://localhost/phpinfo.php
  4. If PHP 7.2 is correctly installed, you should see the PHP information page
  5. Verify that the PHP version displayed is 7.2.x
  6. Check that the loaded configuration file path points to your php.ini file