Skip to content

Instantly share code, notes, and snippets.

@mitchjam
Last active May 26, 2020 23:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchjam/6f478301817771301ede4b93006be88a to your computer and use it in GitHub Desktop.
Save mitchjam/6f478301817771301ede4b93006be88a to your computer and use it in GitHub Desktop.
Use old versions of PHP with Laravel Valet via Homebrew

Homebrew removes old versions of php

And, since Laravel Valet uses Homebrew in it's valet use php@X.X command,
that means trying to install php@7.1 now breaks because Homebrew removed it from it's core.

To install php@7.1 with Homebrew

We need to tap a barrel that has the php@7.1 formula.

brew tap exolnet/homebrew-deprecated

^this is a tap I found that had the php@7.1 and php@5.6 formulas

Now we can call, as normal:

valet use php@7.1

...as well as the standard brew commands

brew install php@7.1
brew link php@7.1

@rcubitto
Copy link

rcubitto commented May 26, 2020

That worked but wasn't enough for me. I had to reinstall PHP 7.1 from source.

$ brew list --versions icu4c
icu4c 66.1

$ brew list --versions openssl
openssl@1.1 1.1.1g

$ brew reinstall --build-from-source php@7.1

$ php -v

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