installphp.info


← Back to home page

Install PHP 8.1 on Windows 10

Warning! This version of PHP is outdated.

PHP 8.1 reached end of active support on 25 Nov 2023. As of today, PHP 8.1 is only receiving security related updates through 31 Dec 2025, at which point it will be considered end-of-life and receive no further updates. It's strongly recommended to upgrade to the latest version of PHP before then.

Installing PHP 8.1 on Windows 10

Prerequisites

  • Windows 10 (64-bit recommended)
  • Administrative privileges
  • Internet connection
  • Web server (e.g., Apache, IIS) installed (optional)

Installation

  1. Visit the official PHP website: https://windows.php.net/download/
  2. Download the PHP 8.1 ZIP package for Windows (x64 Non Thread Safe)
  3. Create a new folder in C:\ drive (e.g., C:\php)
  4. Extract the contents of the ZIP file to the newly created folder
  5. Rename the php.ini-development file to php.ini
  6. Open php.ini and uncomment the following lines by removing the semicolon:
    • extension_dir = "ext"
    • extension=mysqli
    • extension=pdo_mysql
  7. Add the PHP installation directory (e.g., C:\php) to the system PATH:
    1. Open System Properties
    2. Click on "Environment Variables"
    3. Under "System variables", find and edit "Path"
    4. Click "New" and add the PHP installation directory
    5. Click "OK" to save changes

Verification

  1. Open Command Prompt
  2. Type php -v and press Enter
  3. You should see output similar to:
    PHP 8.1.x (cli) (built: ...) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.x, Copyright (c) Zend Technologies
                    
  4. To verify PHP is working with your web server, create a file named info.php in your web 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 the PHP information page, the installation is successful