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.
How to install DNS server on ubuntu 18.04 ?