Skip to content

Instantly share code, notes, and snippets.

@akhileshdarjee
Last active November 30, 2021 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhileshdarjee/5c9185dd0210ac96cdb279fc8d68a778 to your computer and use it in GitHub Desktop.
Save akhileshdarjee/5c9185dd0210ac96cdb279fc8d68a778 to your computer and use it in GitHub Desktop.
Change PHP version system wide
## Interactive Mode
sudo update-alternatives --config php
sudo update-alternatives --config phar
sudo update-alternatives --config phar.phar
## Manual Mode
Apache (Webserver):
sudo a2dismod php7.4 -> PHP version which is currently enabled `php -v`
sudo a2enmod php8.0 -> PHP version you want to enable
sudo service apache2 restart
Command Line:
sudo update-alternatives --set php /usr/bin/php8.0
sudo update-alternatives --set phar /usr/bin/phar8.0
sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment