Last active
December 15, 2017 13:18
-
-
Save mahfuzul/1a3609459bd5860a7217219bff2270a5 to your computer and use it in GitHub Desktop.
Switch between Multiple PHP Version on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##From PHP 5.6 => PHP 7.1 | |
Default PHP 5.6 is set on your system and you need to switch to PHP 7.1. Run the following commands to switch for Apache and command line. | |
#Apache:- | |
$ sudo a2dismod php5.6 | |
$ sudo a2enmod php7.1 | |
$ sudo service apache2 restart | |
#Command Line:- | |
$ sudo update-alternatives --set php /usr/bin/php7.1 | |
$ sudo update-alternatives --set phar /usr/bin/phar7.1 | |
$ sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1 | |
================================== | |
##From PHP 7.1 => PHP 5.6 | |
Default PHP 7.1 is set on your system and you need to switch to PHP 5.6. Now run the following commands to switch for Apache and command line. | |
#Apache:- | |
$ sudo a2dismod php7.1 | |
$ sudo a2enmod php5.6 | |
$ sudo service apache2 restart | |
#Command Line:- | |
$ sudo update-alternatives --set php /usr/bin/php5.6 | |
$ sudo update-alternatives --set phar /usr/bin/phar5.6 | |
$ sudo update-alternatives --set phar.phar /usr/bin/phar.phar5.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment