Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install php72 on MacOS using brew

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 ?

like image 347
Ugo Lfe Avatar asked Dec 27 '18 08:12

Ugo Lfe


3 Answers

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]
like image 148
Ugo Lfe Avatar answered Oct 14 '22 03:10

Ugo Lfe


This worked for me

brew upgrade
brew unlink php71
brew install php72

then in your ~/.bash_profile

export PATH=/usr/local/Cellar/php\@7.2/7.2.26/bin/:$PATH
like image 34
Matt Doran Avatar answered Oct 14 '22 02:10

Matt Doran


Installing PHP 7.2 on Mac using Homebrew

Check version

  php -v

check brew is up to date

  brew update

  brew upgrade

Unlink php version which is installed in the system

  brew unlink php71

Now final step to download**

  brew install php72

  export PATH=/usr/local/php5/bin:$PATH  
like image 26
Siddharth Shukla Avatar answered Oct 14 '22 02:10

Siddharth Shukla