Last active
August 29, 2015 14:06
-
-
Save vremy/86f17a22da798ac94d79 to your computer and use it in GitHub Desktop.
phpbrew version switcher
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 | |
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created this wrapper for phpbrew because it did not work out of the box (BUG!) :p