Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fazni/31b4c047ab0d10574a8e462ffbaa7565 to your computer and use it in GitHub Desktop.
Save fazni/31b4c047ab0d10574a8e462ffbaa7565 to your computer and use it in GitHub Desktop.
Switch Between Multiple PHP Versions In Ubuntu

Switch from PHP7.x to PHP7.x

sudo a2dismod php7.1

sudo a2enmod php7.3

To activate the new configuration, you need to run:

systemctl restart apache2

  1. sudo update-alternatives --set php /usr/bin/php7.3
  2. sudo update-alternatives --set phar /usr/bin/phar7.3
  3. sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.3
  4. sudo update-alternatives --set phpize /usr/bin/phpize7.3
  5. sudo update-alternatives --set php-config /usr/bin/php-config7.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment