Skip to content

Instantly share code, notes, and snippets.

@jcastellanos926
Created March 18, 2019 17:38
Show Gist options
  • Save jcastellanos926/4336bec542fcfcdcea956e1a9f7df136 to your computer and use it in GitHub Desktop.
Save jcastellanos926/4336bec542fcfcdcea956e1a9f7df136 to your computer and use it in GitHub Desktop.
How to switch between PHP versions on ubuntu

swich-php-version

[linux] How to swich php version

  • Switch php7.1 to php5.6:

    • Apache: sudo a2dismod php7.1 ; sudo a2enmod php5.6 ; sudo service apache2 restart ;
    • CLI: sudo update-alternatives --set php /usr/bin/php5.6 ;
  • Switch php5.6 to php7.1:

    • Apache: sudo a2dismod php5.6 ; sudo a2enmod php7.1 ; sudo service apache2 restart ;
    • CLI: sudo update-alternatives --set php /usr/bin/php7.1 ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment