"Saruman believes it is only great power that can hold evil in check, but that is not what I have found. I found it is the small everyday deeds of ordinary folk that keep the darkness at bay. Small acts of kindness and love." --Gandalf

How to switch the currently active version of PHP in Ubuntu at the command line

Tuesday, August 10th, 2021

Open a Terminal in Ubuntu (CTRL + ALT + T)

At the prompt, type:

sudo update-alternatives --config php


Select the version of PHP that is needed from the menu.

Menu that appears after typing the PHP switch command


Verify that PHP switched with php -v

Output from the php -v command

Views: 488