How To Install PHP 7.4, 7.3, 7.2 & 7.1 on Ubuntu 19.10

The PHP Version 7.4.0 has been released on November 28, 2019. PHP 7.4 comes with a remarkable amount of new features. PHP is an open-source server scripting language use for creating dynamic web applications and websites. PHP is a widely-used programming language in the Web. You can also check more features in the PHP official site.

Useful Articles:

Use the following steps to install PHP 7.4 on Ubuntu 19.04/18.04/16.04.

Add PHP PPA Repository

First, we’ll add the PHP repository to install the PHP. Use mention commands to add the PHP repository.

$ sudo apt-get update
$ sudo apt -y install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update

Install PHP on Ubuntu

Now, you are ready to install PHP based on your requirement. In this article, we will install the PHP 7.4

## Install PHP 7.4 ##

$ apt -y install php7.4

## Install PHP 7.3 ##

$ apt -y install php7.3

## Install PHP 7.2 ##

$ apt -y install php7.2

## Install PHP 7.1 ##

$ apt -y install php7.1

I have installed PHP 7.4 on my system. Now you are ready to run the following command to check PHP version on my system.

$ php -v
PHP 7.4.5 (cli) (built: Apr 19 2020 07:36:46) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.5, Copyright (c), by Zend Technologies

Use the next command to install additional packages:

$ sudo apt-get install php7.4-{xml,soap,xmlrpc,mbstring,json,gd,mcrypt,zip,intl}

PHP configurations related to Apache file is stored in /etc/php/7.4/apache2/php.ini

Enjoy it!

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.