installphp.info


← Back to home page

Install PHP 7.4 on Debian 11

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 Debian 11

Prerequisites

  • A Debian 11 system with root or sudo access
  • A working internet connection
  • Basic knowledge of terminal commands

Installation

  1. Update the package list:
    sudo apt update
  2. Install PHP 7.4 and common extensions:
    sudo apt install php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mysql php7.4-zip php7.4-fpm php7.4-mbstring
  3. Wait for the installation to complete

Verification

  1. Check the PHP version:
    php -v
  2. The output should display PHP 7.4.x
  3. Verify PHP configuration:
    php -i
  4. This will show detailed PHP configuration information