installphp.info


← Back to home page

Install PHP 7.1 on Windows 7

This version of PHP is actively supported.

Good news! PHP 7.1 is being actively supported through 20 Sep 2024. After that point, it's advisable to upgrade to the latest version, since the PHP team will only offer security-related support until 20 Sep 2024, at which point PHP 7.1 will be considered "end-of-life".

Installing PHP 7.1 on Windows 7

Prerequisites

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

Installation

  1. Visit the official PHP website: https://www.php.net/downloads
  2. Download the PHP 7.1 Windows ZIP package (choose either 32-bit or 64-bit based on your system)
  3. Create a new folder named "php" in your C:\ drive (C:\php)
  4. Extract the contents of the downloaded ZIP file into the C:\php folder
  5. Rename the file "php.ini-development" to "php.ini" in the C:\php folder
  6. Open the "php.ini" file with a text editor and make the following changes:
    • Uncomment the line containing "extension_dir = "ext"" by removing the semicolon at the beginning
    • Uncomment any extensions you want to enable (e.g., mysql, gd2, etc.) by removing the semicolon at the beginning of the respective lines
  7. Add C:\php to your system's PATH environment variable:
    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 select "Path", then click "Edit"
    5. Add ";C:\php" to the end of the "Variable value" field
    6. Click "OK" to close all windows

Verification

  1. Open Command Prompt (cmd.exe)
  2. Type "php -v" and press Enter
  3. If PHP is installed correctly, you should see output similar to:
    PHP 7.1.x (cli) (built: ...) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
            
  4. To test if PHP is working with your 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 successful, you should see a page displaying detailed PHP configuration information