简体   繁体   中英

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?

I found the solution.

Instead of installing php72 you must specify version like this php@7.2.

brew unlink [your actual php version linked]
brew install php@7.2
brew link php@7.2

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  

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
brew tap homebrew/homebrew-php
brew unlink php71
brew install php72 --with-argon2 
brew install php72-xdebug

For more info follow url https://murze.be/how-to-upgrade-from-php-71-to-72-on-macos-using-homebrew

Note older version's of Mac OS are not supported, I'm trying with docker which also doesn't support older versions of Mac OS completely (no desktop version). Trying with just docker machine as follows;

base=https://github.com/docker/machine/releases/download/v0.16.0 &&
  curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/usr/local/bin/docker-machine &&
  chmod +x /usr/local/bin/docker-machine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM