installphp.info


← Back to home page

Install PHP 8.1 on Windows 11

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 11

Prerequisites

  • Windows 11 operating system
  • Administrator access to your computer
  • Stable internet connection
  • Web server software (e.g., Apache, Nginx) if you plan to run PHP as a web server module

Installation

  1. Visit the official PHP website: https://www.php.net/downloads
  2. Download the latest PHP 8.1 Windows ZIP package (Thread Safe version recommended for most users)
  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 file 'php.ini-development' to 'php.ini'
  6. Open the 'php.ini' file in a text editor and uncomment the following lines by removing the semicolon (;) at the beginning:
    • extension_dir = "ext"
    • extension=mbstring
    • extension=curl
    • extension=gd
    • extension=pdo_mysql
  7. Add C:\php to your system's PATH environment variable:
    1. Open the Start menu and search for "Environment Variables"
    2. Click on "Edit the system environment variables"
    3. Click the "Environment Variables" button
    4. Under "System variables", find and select the "Path" variable, 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 the following command and press Enter:
    php -v
  3. You should see output similar to:
    PHP 8.1.x (cli) (built: ...) (...) ( ... )
  4. To verify 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 this file through your web browser (e.g., http://localhost/info.php)
  6. If you see a page with detailed PHP configuration information, the installation is successful