installphp.info


← Back to home page

Install PHP 8.1 on Server 2019

Warning! This version of PHP is outdated.

PHP 8.1 reached end of active support on 25 Nov 2023. As of today, PHP 8.1 is only receiving security related updates through 31 Dec 2025, at which point it will be considered end-of-life and receive no further updates. It's strongly recommended to upgrade to the latest version of PHP before then.

Installing PHP 8.1 on Server 2019

Prerequisites

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

Installation

  1. Download PHP 8.1 for Windows from the official PHP website (https://windows.php.net/download/)
  2. Extract the downloaded ZIP file to a directory (e.g., C:\PHP8.1)
  3. Rename php.ini-production to php.ini
  4. Edit php.ini and make necessary adjustments (e.g., enable required extensions)
  5. Add the PHP directory to the system's PATH environment variable
  6. Install the necessary Visual C++ Redistributable packages
  7. Configure IIS to handle PHP requests:
    • Open IIS Manager
    • Select your server in the connections pane
    • Open the "Handler Mappings" feature
    • Add a new module mapping for PHP
  8. Restart the IIS service

Verification

  1. Create a test PHP file (e.g., phpinfo.php) with the following content:
    <?php phpinfo(); ?>
  2. Save the file in your web server's root directory
  3. Open a web browser and navigate to http://localhost/phpinfo.php
  4. If PHP is correctly installed, you should see the PHP information page
  5. Verify that the PHP version displayed is 8.1.x
  6. Check that the necessary extensions are enabled