Last active
May 3, 2018 23:51
-
-
Save thisismzm/51a68eccfea554cad684d5892a2f2ee2 to your computer and use it in GitHub Desktop.
This is a bash script for switch between PHP versions that are enable as Apache2 webserver module.
This file contains hidden or 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
#!/bin/bash | |
sudo update-alternatives --set php "/usr/bin/php$2"; | |
sudo update-alternatives --set "php-config" "/usr/bin/php-config$2"; | |
sudo update-alternatives --set phpize "/usr/bin/phpize$2"; | |
sudo a2dismod "php$1" | |
sudo a2enmod "php$2" | |
sudo service apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use it with the following command:
This will switch
PHP5.6
toPHP7.2
.