installphp.info


← Back to home page

Install PHP 7.2 on Windows 7

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 7

Prerequisites

  • Windows 7 (32-bit or 64-bit)
  • Administrative access to your computer
  • Internet connection for downloading PHP
  • Web server software (e.g., Apache or IIS) installed

Installation

  1. Download PHP 7.2 from the official PHP website (php.net)
  2. Extract the downloaded ZIP file to a directory (e.g., C:\php)
  3. Rename php.ini-development to php.ini in the PHP directory
  4. Open php.ini and make the following changes:
    • Uncomment extension_dir = "ext"
    • Uncomment required extensions (e.g., mysql, gd, etc.)
  5. Add PHP to the system PATH:
    1. Right-click on "Computer" and select "Properties"
    2. Click on "Advanced system settings"
    3. Click on "Environment Variables"
    4. Under "System variables", find and edit "Path"
    5. Add the PHP directory path (e.g., C:\php) to the end, separated by a semicolon
  6. Configure your web server to work with PHP
  7. Restart your web server

Verification

  1. Open a command prompt and type php -v. This should display the PHP version information.
  2. Create a PHP file (e.g., info.php) in your web server's document root with the following content:
    <?php phpinfo(); ?>
  3. Open a web browser and navigate to http://localhost/info.php
  4. If PHP is installed correctly, you should see the PHP information page