installphp.info


← Back to home page

Install PHP 7.2 on Windows 11

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 Windows 11

Prerequisites

  • Windows 11 operating system
  • Administrative privileges on your computer
  • Internet connection for downloading the PHP installer
  • Web server software (e.g., Apache or IIS) if you plan to use PHP for web development

Installation

  1. Visit the official PHP website: https://windows.php.net/download#php-7.2
  2. Download the PHP 7.2 ZIP package for Windows (x64 Non Thread Safe)
  3. Create a new folder at C:\PHP7.2
  4. Extract the contents of the ZIP file to the C:\PHP7.2 folder
  5. Open the Windows Environment Variables settings
  6. Add C:\PHP7.2 to the system PATH variable
  7. Rename php.ini-development to php.ini
  8. Open php.ini and uncomment the required extensions by removing the semicolon (;) at the beginning of the line

Verification

  1. Open Command Prompt
  2. Type php -v and press Enter
  3. You should see output similar to:
    PHP 7.2.34 (cli) (built: Dec 17 2020 16:01:35) ( ZTS MSVC15 (Visual C++ 2017) x64 )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
            
  4. To test PHP with a web server, create a file named info.php in your web server's document root with the following content:
    <?php
    phpinfo();
    ?>
            
  5. Access the file through your web browser (e.g., http://localhost/info.php)
  6. If you see a page with detailed PHP configuration information, the installation was successful