Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save haljeshi/329a0fb0c6df43f3fc904d716a96af1b to your computer and use it in GitHub Desktop.
Save haljeshi/329a0fb0c6df43f3fc904d716a96af1b to your computer and use it in GitHub Desktop.
#!/bin/sh
FROMVERSION=$(php -v|grep --only-matching --perl-regexp "(PHP )\d+\.\\d+\.\\d+"|cut -c 5-7);
TOVERSION="$1"
update-alternatives --set php /usr/bin/php$TOVERSION
a2dismod php$FROMVERSION
a2enmod php$TOVERSION
service apache2 restart
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment