Created
August 18, 2018 18:51
-
-
Save acodeninja/aecf0deae71bd52f662e0e9bc6485915 to your computer and use it in GitHub Desktop.
A small script to switch php versions inside of homestead
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
VERSION=$1 | |
if [ "$(which php${VERSION})" != "" ]; then | |
sudo update-alternatives --set php /usr/bin/php$VERSION | |
sudo update-alternatives --set phar /usr/bin/phar$VERSION | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$VERSION | |
sudo update-alternatives --set phpize /usr/bin/phpize$VERSION | |
sudo update-alternatives --set php-config /usr/bin/php-config$VERSION | |
echo "Switched to php$VERSION successfully" | |
else | |
echo "Could not find php$VERSION" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment