installphp.info


← Back to home page

Install PHP 7.4 on Windows 10

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

PHP 7.4 reached end of life on 28 Nov 2022 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.4 on Windows 10

Prerequisites

  • Windows 10 operating system
  • Administrative privileges on your computer
  • Internet connection for downloading PHP
  • Web server (e.g., Apache, IIS) installed (optional)

Installation

  1. Download PHP 7.4 from the official PHP website (php.net)
  2. Extract the downloaded ZIP file to a directory (e.g., C:\php)
  3. Copy php.ini-development to php.ini in the same directory
  4. Open php.ini and uncomment the following lines:
    • extension_dir = "ext"
    • extension=mysqli
    • extension=pdo_mysql
  5. Add the PHP directory to the system PATH:
    1. Right-click on 'This PC' 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 (e.g., C:\php) to the list
  6. Restart your computer to apply the changes

Verification

  1. Open Command Prompt
  2. Type "php -v" and press Enter
  3. You should see output similar to:
    PHP 7.4.x (cli) (built: Month Day Year) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
  4. Create a PHP file (e.g., info.php) with the following content:
    <?php
    phpinfo();
    ?>
  5. Place the file in your web server's document root
  6. Access the file through your web browser (e.g., http://localhost/info.php)
  7. If you see the PHP information page, the installation is successful