How to Upgrade PHP from 7.2 to 7.3 on Ubuntu OS
Hello friends, In this article I am going to show you how to upgrade your PHP version from 7.2 to 7.3 in ubuntu OS in easy few steps. It is necessary to keep your PHP version up to date for several security reasons. And we are not going to delete the 7.2 version from the system because in case if the latest version didn’t compatible with your OS, you can revert it to old one anytime.
So lets get start. Follow below steps.
Check the current PHP version
php -v
Add the required repository to begin update
add-apt-repository ppa:ondrej/php
Now run an update
apt-get update
Now you can install PHP 7.3 with following code
apt install php7.3
Install the required packages for this version
apt install php7.3-common php7.3-cli php7.3-bz2 php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-readline php7.3-xml php7.3-zip php7.3-fpm php7.3-bcmath php7.3-mbstring
So we can disable PHP 7.2 and enable PHP 7.3 now
a2dismod php7.2
a2enmod php7.3
Now restart Apache
service apache2 restart
The new PHP version (7.3) will be activated now. You can confirm it by typing following code
php -v
That’s it!! if you have any question please comment below.
Or check my latest posts.