Skip to content

Instantly share code, notes, and snippets.

@vremy
Last active August 29, 2015 14:06
Show Gist options
  • Save vremy/86f17a22da798ac94d79 to your computer and use it in GitHub Desktop.
Save vremy/86f17a22da798ac94d79 to your computer and use it in GitHub Desktop.
phpbrew version switcher
#!/bin/bash
if [ ! -z $1 ]; then
if [ $1 == 'list' ]; then
echo ''
echo 'Available PHP versions'
echo '----------------------'
ls -al /opt/phpbrew/php/ | grep php | cut -d '-' -f 4
echo ''
fi
if [[ $1 =~ (4|5|6).[0-9].[0-9]{1,2} ]]; then
echo 'Loading PHP '$1'...'
sudo su -l root -c "echo 'LoadModule php5_module /usr/lib/apache2/modules/libphp'$1'.so' > /etc/apache2/mods-available/php5.load"
sudo su -l root -c "service apache2 restart"
fi
fi
@vremy
Copy link
Author

vremy commented Sep 27, 2014

Created this wrapper for phpbrew because it did not work out of the box (BUG!) :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment