Skip to content

Instantly share code, notes, and snippets.

@d0d0
Forked from bgarrant/ValetSwitchPHP.md
Created July 2, 2018 18:34
Show Gist options
  • Save d0d0/4d27f9363290117b5f4f179b81e74a17 to your computer and use it in GitHub Desktop.
Save d0d0/4d27f9363290117b5f4f179b81e74a17 to your computer and use it in GitHub Desktop.
How to Switch PHP Version in Laravel Valet between PHP 7.1 and PHP 5.6

Valet switch PHP version with these commands

Install PHP 5.6 and switch Valet to PHP 5.6

valet stop
brew unlink php71
brew install php56
brew install php56-mcrypt
brew link php56
valet start

Then to switch back to PHP 7.1 it is as simple as:

valet stop
brew unlink php56
brew link php71
valet start

Then to switch to PHP 5.6:

valet stop
brew unlink php71
brew link php56
valet start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment