Usage:
update-my-alternatives --config phpCreate this alias (preferably in .bashrc)
alias update-my-alternatives='update-alternatives --altdir ~/.local/etc/alternatives --admindir ~/.local/var/lib/alternatives'If it does not already exist, make this directory:
~/.local/binAdd this to your path, in front of everything else:
$HOME/.local/binRun this script
for VERSION in 7.4 8.0 8.1 8.2 8.3;do
update-my-alternatives --install $HOME/.local/bin/php php /usr/bin/php${VERSION} ${VERSION//./0}
doneNow should be able to run:
update-my-alternatives --config php