How to set a Default PHP version in Ubuntu

Sometimes you need to have several PHP versions on your server or machine.

sudo update-alternatives --config php

This command will prompt you to select the version you want.

sudo update-alternatives --set /usr/bin/php7.4

That's it.

Victor Yoalli

This is me.