If you are running into issues with a version of PHP running and want to swap the active PHP to a different version you can simply run the command below on Ubuntu to get an interactive menu to swap PHP versions…
$sudo update-alternatives --config php
Sources:
And: