Info
This is a guide to change your PHP version through the command line on Ubuntu 22.04
Installed versions list
To list all the installed PHP versions on your local device, use the following command :
sudo update-alternatives --config php
Change active PHP version
To change your currently used PHP version to a different version (that is installed), you can use the following command:
sudo update-alternatives --set php /usr/bin/php${version}
Top comments (3)
Hi ! On fact this question didn't exist anymore as soon as you use Docker. Just use the image with the version you want and tadaaa. If you are a web developer, take time to follow a tutorial, you'll not regret I think.
Thanks for the tip, will look into it
you save my day