How to Upgrade PHP from 7.3 to 7.4 on Ubuntu OS
Hello friends, In this article, I am going to show you how to upgrade your PHP version from 7.3 to 7.4 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.3 version from the system because in case if the latest version didn’t compatible with your OS, you can revert it to the old one anytime.
So lets get start. Follow below steps.
Check the current PHP version
php -v
Add the required repository to begin update
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Now you can install PHP 7.4 with following code
sudo apt install php7.4
Install the required extensions for this version
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y
The new PHP version (7.4) will be activated now. You can confirm it by typing following code
php -v
So we can disable PHP 7.2 and enable PHP 7.3 now
sudo a2dismod php7.0
sudo a2enmod php7.4
Now restart Apache
service apache2 restart
That’s it!! if you have any question please comment below.
Or check my latest posts.