In this tutorial, we will learn how to set the default php version in ubuntu. we usually use ubuntu server. so we will see an example of how to change php version in ubuntu.
There are many ways to easily set the default php version in ubuntu. so you can see the following example.
PHP 5.6 default is configured on your system and you need to change to PHP 7.1 then you can following example.
sudo a2dismod php5.6
sudo a2enmod php7.1
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php7.1