Last updated on August 28th, 2020 at 05:14 pm
Note: If you want to upgrade to PHP 7.4 you can check this post.
In this post I am going to explain to you how we can install PHP 7.3 in your Ubuntu. PHP 7.3 is under development and going to release soon, but we can install PHP 7.3 and test all the feature in the development phase using ondrej/php.
Please follow below steps to install the latest version of PHP 7.3
Step 1. Open the terminal and add ondrej/php package which has latest PHP version to add run below command.
sudo apt-get update sudo add-apt-repository ppa:ondrej/php
after adding repository run update command again
sudo apt-get update
Step 2. Now we can add the latest version of PHP to do that run below command in terminal
sudo apt-get install php7.3
Step 3. Once Install process is complete check the version of PHP in terminal using below command.
Step 4. Now if you want to add any PHP extension run command on terminal like shown in below code snippet
sudo apt-get install php7.3-[entension name]
Eg. If you want to install Curl, MySQL extension and PHP FPM extension run below command
sudo apt-get install php7.3-fpm php7.3-curl php7.3-mysql
Now if you want to restart PHP run below command to restart
sudo systemctl restart php7.3-fpm
Hope this post helps you.