How To Install PHP (7.2 / 7.3) In Ubuntu 18.04/20.04

In this tutorial, we’ll show you how to install PHP 7.2 or 7.3 on Ubuntu 18.04/20.04.

How To Install PHP (7.2 / 7.3) In Ubuntu 18.04

  • Install PHP 7.2
  • Install PHP 7.3

Install PHP 7.2

Run the following command to install PPA for PHP 7.2 version:

sudo apt-get install python-software-properties -y 

sudo add-apt-repository ppa:ondrej/php

Run apt-get update command to update system packages:

sudo apt-get update

Run the following command to install PHP 7.2 On Ubuntu:

sudo apt-get install php7.2

Check the PHP version:

php -v

Option, install required PHP 7.2 Extensions:

sudo apt-get install php7.2-fpm  php7.2-curl php7.2-mysql \ php7.2-xml php7.2-zip php7.2-gd

Install PHP 7.3

To install PPA for PHP 7.3:

sudo apt-get install python-software-properties -y  

sudo add-apt-repository ppa:ondrej/php

Next, update system packages using the following command:

sudo apt-get update

Run the following command with specific version of PHP that install in ubuntu:

sudo apt-get install php7.3

Use the below command to check the PHP version installed on your server :

php -v

Install PHP 7.3 Extensions:

sudo apt-get install php7.3-fpm  php7.3-curl php7.3-mysql \ php7.3-xml php7.3-zip php7.3-gd

Conclusion

In this article, You have learned how to install PHP 7.2 or PHP 7.3 on your Ubuntu 18.04/20 server with using the PPA. 

If you have any questions or thoughts to share, use the comment form below to reach us.

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

One reply to How To Install PHP (7.2 / 7.3) In Ubuntu 18.04/20.04

  1. How to install DNS server on ubuntu 18.04 ?

Leave a Reply

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