Skip to content

Instantly share code, notes, and snippets.

@grandmanitou
Created October 28, 2021 08:52
Show Gist options
  • Save grandmanitou/c9ccf7c9e74d1b72541781a15d49045a to your computer and use it in GitHub Desktop.
Save grandmanitou/c9ccf7c9e74d1b72541781a15d49045a to your computer and use it in GitHub Desktop.
Switch between PHP version in Ubuntu

How to change the PHP version you’re using If you have multiple PHP versions installed on your Ubuntu server, you can change what version is the default one.

To set PHP 7.4 as the default, run:

update-alternatives --set php /usr/bin/php7.4 To set PHP 8.0 as the default, run:

update-alternatives --set php /usr/bin/php8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment