Install php72 on MacOS using brew

Ugo Lfe picture Ugo Lfe · Dec 27, 2018 · Viewed 9.5k times · Source

I'm trying to install php72 using brew.

Actually when I do brew install php72 it's downloading "https://homebrew.bintray.com/bottles/php-7.3.0.mojave.bottle.tar.gz".

So when I check php version it's showing me PHP 7.3.0 (cli).

How can I install exactly php72 and not php73 ?

Answer

Ugo Lfe picture Ugo Lfe · Dec 27, 2018

I found the solution.

Instead of installing php72 you must specify version like this [email protected].

brew unlink [your actual php version linked]
brew install [email protected]
brew link [email protected]