Created
August 26, 2020 07:36
-
-
Save AntoineTurmel/3db05e8bdaa7b52592b5069ccaf68681 to your computer and use it in GitHub Desktop.
Simple script to switch from a php version to another on Ubuntu
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 | |
phpver=`php -r "echo phpversion();"` | |
if [ "`echo $phpver | grep '7.4'`" ]; then | |
echo "Bascule sur PHP 5.6.x" | |
sudo a2dismod php7.4 | |
sudo a2enmod php5.6 | |
sudo update-alternatives --set php /usr/bin/php5.6 | |
sudo service apache2 restart | |
fi | |
if [ "`echo $phpver | grep '5.6'`" ]; then | |
echo "Bascule sur PHP 7.4.x" | |
sudo a2dismod php5.6 | |
sudo a2enmod php7.4 | |
sudo update-alternatives --set php /usr/bin/php7.4 | |
sudo service apache2 restart | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment