![](/images/homepage/php-version-change-ubuntu.jpg)
How to switch the currently active version of PHP in Ubuntu at the command line
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](/images/homepage/php-version-change-ubuntu.png)
Verify that PHP switched with php -v
![Output from the php -v command](/images/homepage/php-v.png)