How to install the latest stable PHP 7.2 in Ubuntu Linux.

In this post I’m going to show you how to install PHP 7.2 in Ubuntu 16.04 system.

PHP7.2 banner

PHP7.2

Beginning with Ubuntu 16.04, PHP 7 has replaced PHP 5 as the default PHP version in the Ubuntu software repository. And can be installed by simply using the command:

sudo apt-get install php7

But PHP 7.2 is the latest stable version in the line of PHP7 series (as at the time of writing this article). And that is what is going to install in this article. The PHP 7 series of versions are loaded with a lot of attractive features (compared to PHP 5.x) that many long time PHP developers have long desired. This include but not limited to;

– Increased speed

Security and bug fixes.

New/Improved syntax types. Etc.

To install in Ubuntu follow the steps outlined below;

#1: Add the PPA to your system:

 

Sudo add-apt-repository -y ppa:ondrej/php

 

READ: Learn more about (PPA) here.

 

#2: Update your system software repository:

sudo apt-get update

 

#3: Install PHP7:

 

sudo apt-get install php7.2

 

You can confirm that it was installed in your system using the following command:

php -v

 

OPTIONAL: List (view) available PHP modules for PHP7.2

You can check the modules that are available for your version of PHP using the command:

 

apt-cache pkgnames | grep php7.2

 

READ: You can also learn how to install a full LAMP (Apache, MySQL, PHP on Linux) stack.

 

Happy Linux’NG!

Share!

ALEXANDER WAYNE OMOROKUNWA

ALEXANDER WAYNE OMOROKUNWA

Chief Editor/Founder at FossNaija
A Linux enthusiast with a focus on enriching the Nigeria Linux experience and keeping a keen eye on Ubuntu and other Foss related developments.
ALEXANDER WAYNE OMOROKUNWA

Latest posts by ALEXANDER WAYNE OMOROKUNWA (see all)

READ  Why these 5 myths about the Linux command-line are false

Tell us what you think

This site uses Akismet to reduce spam. Learn how your comment data is processed.