Skip to content

Instantly share code, notes, and snippets.

@vutranvn
Created March 30, 2018 14:46
Show Gist options
  • Save vutranvn/5e9e291a1781553fffc840038b677295 to your computer and use it in GitHub Desktop.
Save vutranvn/5e9e291a1781553fffc840038b677295 to your computer and use it in GitHub Desktop.
Switch multi version php on brew in macOS
- To launch php-fpm on startup:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
- Open ~/.bash_profile and add:
export PATH="/usr/local/sbin:$PATH"
- To have launchd start homebrew/php/php56 now and restart at login:
brew services start homebrew/php/php56
- In this case, have php7.1 and php5.6. Wanna switch php7.1
brew services stop homebrew/php/php56
brew unlink php56
brew link php71
brew services start homebrew/php/php71
- To have launchd start mariadb now and restart at login:
brew services start mariadb
- Or, if you don't want/need a background service you can just run:
mysql.server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment