installphp.info


← Back to home page

Install PHP 8.1 on Windows 7

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 7

Prerequisites

  • Windows 7 (32-bit or 64-bit)
  • Administrative privileges on your computer
  • Internet connection for downloading PHP
  • 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 (Thread Safe or Non-Thread Safe version, depending on your needs)
  3. Create a new folder in your 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 in a text editor and make the following changes:
    • Uncomment the line containing extension_dir by removing the semicolon (;) at the beginning
    • Uncomment any extensions you need (e.g., mysqli, pdo_mysql)
  7. Add the PHP directory (C:\php) to your system's PATH environment variable
  8. If using a web server, configure it to work with PHP (refer to your web server's documentation)

Verification

  1. Open a command prompt and type php -v. This should display the PHP version information.
  2. Create a file named info.php in your web server's document root with the following content:
    <?php phpinfo(); ?>
  3. Access the info.php file through your web browser (e.g., http://localhost/info.php). You should see the PHP information page.
  4. Check that the PHP version displayed is 8.1.x and that all required extensions are enabled.