Last active
January 8, 2019 10:44
-
-
Save botris/2514d3903412d0f407e42d8225a3777c to your computer and use it in GitHub Desktop.
Ubuntu 18.10 switch php7.1 and php7.2
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
ATM php7.2 is current to Ubuntu. | |
Add php7.1 through: | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install php7.1 | |
sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm php7.1-dev php7.1-curl php7.1-xml | |
Switch with script |
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 a2dismod php7.2 | |
sudo a2enmod php7.1 | |
sudo service apache2 restart | |
# Avoid start-limit-hit | |
sleep 10s | |
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 | |
sudo update-alternatives --set phpize /usr/bin/phpize7.1 | |
sudo update-alternatives --set php-config /usr/bin/php-config7.1 | |
sudo service apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment