Install PHP Version (7.3, 7.2 or 7.0) on Ubuntu 19.04, 18.04 & 16.04 via PPA

PHP-logo

Thanks to Ondřej Surý for maintaining PPA of most the popular PHP versions on launchpad. PHP 7.3 is the current & stable version of PHP. You can check the PHP Release History. PHP 7.3 has support till 6 December 2020. If you want to install the specific version of PHP, then this article can be helpful for you.

In this article we will help you in installing PHP 7.3, 7.2 or 7.0 using PPA on Ubuntu 19.04 18.10 LTS, 18.04 LTS, 16.04 LTS, 14.04 LTS or 12.04 LTS systems.

Install PHP 7.3 on Ubuntu 19.04, 18.04 & 16.04

PHP 7.3 is the current & stable version of PHP. Use the following set of commands that is installing software-properties-common and then installing the PHP 7.3 from ppa:ondrej/php PPA.


After successfully installation of PHP you can type php -v command to check the installed PHP version and you will see something like this.

php-version-7-3

Install PHP 7.3 Modules Curl, opcache, mysql, zip, xml, GD, json, etc

After installing the PHP version you can install it’s moudules. You can use the following command to install the specific modules. You can remove the undesired modules from below command or add any desired the module but you keep the php version in mind while installing the specific module.

By changing <php-version> with your install php-version & <extension-name> with your desired php extension name you can install PHP extension on your server.

Install PHP 7.2 on Ubuntu 19.04, 18.04 & 16.04

PHP 7.2 is Older version but yet still supported. Use the following set of commands that is installing software-properties-common and then installing the PHP 7.2 from ppa:ondrej/php PPA.

After successfully installation of PHP you can type php -v command to check the installed PHP version and you will see something like this.

php-version-7-2

Install PHP 7.2 Modules Curl, opcache, mysql, zip, xml, GD, json, etc

After installing the PHP version you can install it’s moudules. You can use the following command to install the specific modules. You can remove the undesired modules from below command or add any desired the module but you keep the php version in mind while installing the specific module.

By changing <php-version> with your install php-version & <extension-name> with your desired php extension name you can install PHP extension on your server.

Install PHP 7.0 on Ubuntu 19.04, 18.04 & 16.04

PHP 7.0 is Older version but yet still supported. Use the following set of commands that is installing software-properties-common and then installing the PHP 7.0 from ppa:ondrej/php PPA.

After successfully installation of PHP you can type php -v command to check the installed PHP version and you will see something like this.

php-version-7-0

Install PHP 7.2 Modules Curl, opcache, mysql, zip, xml, GD, json, etc

After installing the PHP version you can install it’s moudules. You can use the following command to install the specific modules. You can remove the undesired modules from below command or add any desired the module but you keep the php version in mind while installing the specific module.

By changing <php-version> with your install php-version & <extension-name> with your desired php extension name you can install PHP extension on your server.

Leave a Reply