installphp.info


← Back to home page

Install PHP 7.1 on Windows 10

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 10

Prerequisites

  • Windows 10 operating system
  • Administrator access to your computer
  • Internet connection for downloading PHP
  • Web server software (e.g., Apache, IIS) if you plan to use PHP for web development

Installation

  1. Visit the official PHP website: https://windows.php.net/download#php-7.1
  2. Download the PHP 7.1 zip package that matches your system architecture (x86 or x64)
  3. Create a new folder in your C: drive named "php"
  4. Extract the contents of the downloaded zip file into the C:\php folder
  5. Rename the php.ini-development file to php.ini
  6. Open the php.ini file in 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 need (e.g., mysql, gd, curl) by removing the semicolon at the beginning of their respective lines
  7. Add C:\php to your system's PATH environment variable:
    1. Right-click on "This PC" or "My 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. Click "New" and add "C:\php"
    6. Click "OK" to close all dialogs

Verification

  1. Open a new Command Prompt window
  2. Type "php -v" and press Enter
  3. 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. If you see this output, PHP 7.1 has been successfully installed and added to your system PATH
  5. To test PHP with your web server, create a file named "phpinfo.php" in your web server's document root with the following content:
    <?php
    phpinfo();
    ?>
            
  6. Access this file through your web browser to see detailed PHP configuration information