Skip to content

Instantly share code, notes, and snippets.

@phptek
Created June 21, 2018 01:03
Show Gist options
  • Save phptek/931dbec61ad66a8fc176edf8274080c2 to your computer and use it in GitHub Desktop.
Save phptek/931dbec61ad66a8fc176edf8274080c2 to your computer and use it in GitHub Desktop.
switchphp
#!/bin/bash
# Assumes Apache httpd
# Russell Michell 2018 <russellmichell+usevagrant@catalyst.net.nz>
from=$1
to=$2
update-alternatives --set php /usr/bin/php$to && a2dismod php$from && a2enmod php$to && service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment