installphp.info


← Back to home page

Install PHP 8.0 on Windows 11

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

PHP 8.0 reached end of life on 26 Nov 2023 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 8.0 on Windows 11

Prerequisites

  • Windows 11 operating system
  • Administrative privileges on your computer
  • Internet connection for downloading the installer
  • Web server software (e.g., Apache or IIS) if you plan to use PHP for web development

Installation

  1. Visit the official PHP website: https://windows.php.net/download/
  2. Download the PHP 8.0 ZIP package for Windows (x64 Non Thread Safe)
  3. Extract the ZIP file to a directory of your choice (e.g., C:\php)
  4. Open the extracted folder and locate the php.ini-development file
  5. Rename php.ini-development 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 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 the path to your PHP directory (e.g., C:\php)
    6. Click "OK" to close all dialog boxes

Verification

  1. Open a new Command Prompt window
  2. Type php -v and press Enter
  3. You should see output similar to:
    PHP 8.0.x (cli) (built: ...) ( ... )
    Copyright (c) The PHP Group
    Zend Engine v4.0.x, Copyright (c) Zend Technologies
  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 the file through your web browser (e.g., http://localhost/info.php)
  6. You should see a page displaying detailed PHP configuration information