installphp.info


← Back to home page

Install PHP 8.0 on Server 2022

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

PHP 8.0 reached end of life on 26 Nov 2023 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 8.0 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 8.0 for Windows from the official PHP website
  2. Extract the downloaded ZIP file to a directory (e.g., C:\PHP8)
  3. Rename php.ini-production to php.ini
  4. Edit php.ini and uncomment necessary extensions
  5. Add PHP directory to system PATH
  6. Install necessary Visual C++ Redistributable packages
  7. Configure IIS to handle PHP requests:
    • Open IIS Manager
    • Select "Handler Mappings"
    • Add a new module mapping for PHP
  8. Restart IIS

Verification

  1. Create a test PHP file (e.g., phpinfo.php) with the following content:
    <?php phpinfo(); ?>
  2. Save the file in the web root directory (usually C:\inetpub\wwwroot)
  3. Open a web browser and navigate to http://localhost/phpinfo.php
  4. Verify that the PHP information page is displayed, showing version 8.0
  5. Check for any error messages or missing extensions