installphp.info


← Back to home page

Install PHP 7.3 on Ubuntu 24.04

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

PHP 7.3 reached end of life on 06 Dec 2021 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.3 on Ubuntu 24.04

Prerequisites

  • Ubuntu 24.04 system
  • User account with sudo privileges
  • Terminal access
  • Internet connection

Installation

  1. Update the package list:

    sudo apt update
  2. Install the software-properties-common package:

    sudo apt install software-properties-common
  3. Add the Ondřej Surý PPA:

    sudo add-apt-repository ppa:ondrej/php
  4. Update the package list again:

    sudo apt update
  5. Install PHP 7.3 and common extensions:

    sudo apt install php7.3 php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-mysql php7.3-mbstring php7.3-xml php7.3-gd php7.3-curl

Verification

  1. Check the installed PHP version:

    php -v

    You should see output similar to:

    PHP 7.3.x (cli) (built: ...) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.x, Copyright (c) 1998-2018 Zend Technologies
  2. Verify PHP configuration:

    php -i

    This will display detailed information about your PHP installation.

  3. Check installed PHP modules:

    php -m

    This will list all installed PHP modules.