Ubuntu Set Alternatives
# Direct
sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set php /usr/bin/php8.0
sudo update-alternatives --set php /usr/bin/php8.1
# To ask:
sudo update-alternatives --config php
# To show current
sudo update-alternatives --query php
Tiago F2