Skip to content

Instantly share code, notes, and snippets.

@dongilbert
Created November 15, 2013 22:06
Show Gist options
  • Save dongilbert/7492449 to your computer and use it in GitHub Desktop.
Save dongilbert/7492449 to your computer and use it in GitHub Desktop.
PHP Quick Switching I've linked up the libphp5.so to a symlinked version in `~/.phpenv/` and also linked up the current version's `bin` folder.
alias php53='brew unlink php53 > /dev/null; brew unlink php54 > /dev/null; brew unlink php55 > /dev/null; brew link php53 > /dev/null; ln -sf /usr/local/Cellar/php53/5.3.26/libexec/apache2/libphp5.so /Users/admin/.phpenv/libphp5.so; ln -sf /usr/local/Cellar/php54/5.3.26/bin /Users/admin/.phpenv/bin; sudo apachectl restart; echo "PHP 5.3 Enabled";'
alias php54='brew unlink php53 > /dev/null; brew unlink php54 > /dev/null; brew unlink php55 > /dev/null; brew link php54 > /dev/null; ln -sf /usr/local/Cellar/php54/5.4.19/libexec/apache2/libphp5.so /Users/admin/.phpenv/libphp5.so; ln -sf /usr/local/Cellar/php54/5.4.19/bin /Users/admin/.phpenv/bin; sudo apachectl restart; echo "PHP 5.4 Enabled";'
alias php55='brew unlink php53 > /dev/null; brew unlink php54 > /dev/null; brew unlink php55 > /dev/null; brew link php55 > /dev/null; ln -sf /usr/local/Cellar/php55/5.5.3/libexec/apache2/libphp5.so /Users/admin/.phpenv/libphp5.so; ln -sf /usr/local/Cellar/php54/5.5.3/bin /Users/admin/.phpenv/bin; sudo apachectl restart; echo "PHP 5.5 Enabled";'
@nateritter
Copy link

Would be better if the /usr/local/Cellar was a variable, as would be the /Users/admin path

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