Created
January 1, 2023 10:40
-
-
Save osadan/5e783a9f9429610f5affbc9aa7cab450 to your computer and use it in GitHub Desktop.
script to switch between php version apache and cli
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
#!/bin/bash | |
echo "changeing from $2 to $4" | |
a2dismod php$2 | |
a2enmod php$4 | |
systemctl restart apache2 | |
update-alternatives --set php /usr/bin/php$4 | |
update-alternatives --set php /usr/bin/phar$4 | |
update-alternatives --set phar.phar /usr/bin/phar.phar$4 | |
update-alternatives --set phpsize /usr/bin/phpsize$4 | |
update-alternatives --set php-config /usr/bin/php-config | |
// call it with the versions as parameter | |
// ./switch-php-version.sh from <current version> to <desired version> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment