installphp.info


← Back to home page

Install PHP 7.4 on Server 2019

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

PHP 7.4 reached end of life on 28 Nov 2022 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.4 on Server 2019

Prerequisites

  • Windows Server 2019 installed and updated
  • Administrative access to the server
  • Internet connection for downloading PHP
  • IIS (Internet Information Services) role installed

Installation

  1. Download PHP 7.4 for Windows from the official PHP website
  2. Extract the downloaded ZIP file to a directory (e.g., C:\PHP7.4)
  3. Rename php.ini-production to php.ini
  4. Edit php.ini and set the extension_dir path
  5. Add PHP to the system PATH environment variable
  6. Install the necessary Visual C++ Redistributable packages
  7. Configure IIS to handle PHP requests:
    • Open IIS Manager
    • Select the server in the left pane
    • Double-click "Handler Mappings"
    • Click "Add Module Mapping" in the right pane
    • Set the following values:
      • Request path: *.php
      • Module: FastCgiModule
      • Executable: C:\PHP7.4\php-cgi.exe
      • Name: PHP_via_FastCGI
    • Click "OK" and "Yes" to create a FastCGI application
  8. Restart the IIS service

Verification

  1. Create a new file named phpinfo.php in the web root directory (usually C:\inetpub\wwwroot) with the following content:
    <?php phpinfo(); ?>
  2. Open a web browser and navigate to http://localhost/phpinfo.php
  3. If PHP is installed correctly, you should see the PHP information page
  4. Verify that the PHP version displayed is 7.4.x
  5. Check that the necessary extensions are enabled