installphp.info


← Back to home page

Install PHP 7.0 on Ubuntu 20.04

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

PHP 7.0 reached end of life on 03 Dec 2018 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.0 on Ubuntu 20.04

Prerequisites

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

Installation

  1. Update the package list:

    sudo apt update
  2. Add the PHP 7.0 PPA repository:

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

    sudo apt update
  4. Install PHP 7.0:

    sudo apt install php7.0
  5. Install common PHP extensions:

    sudo apt install php7.0-cli php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-mbstring php7.0-xml

Verification

  1. Check the PHP version:

    php -v

    You should see output indicating PHP 7.0.x is installed.

  2. Verify PHP configuration:

    php -i

    This will display detailed PHP configuration information.

  3. Check installed PHP modules:

    php -m

    This will list all installed PHP modules.