简体   繁体   English

使用 brew 在 MacOS 上安装 php72

[英]Install php72 on MacOS using brew

I'm trying to install php72 using brew.我正在尝试使用 brew 安装 php72。

Actually when I do brew install php72 it's downloading " https://homebrew.bintray.com/bottles/php-7.3.0.mojave.bottle.tar.gz ".实际上,当我执行brew install php72时,它正在下载“ 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).因此,当我检查 php 版本时,它会显示 PHP 7.3.0 (cli)。

How can I install exactly php72 and not php73?我怎样才能准确安装 php72 而不是 php73?

I found the solution.我找到了解决方案。

Instead of installing php72 you must specify version like this php@7.2.您必须指定版本,而不是安装 php72,例如 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使用 Homebrew 在 Mac 上安装 PHP 7.2

Check version检查版本

  php -v

check brew is up to date检查 brew 是最新的

  brew update

  brew upgrade

Unlink php version which is installed in the system取消链接系统中安装的php版本

  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然后在你的 ~/.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有关更多信息,请访问 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).请注意,不支持旧版本的 Mac OS,我正在尝试使用 docker,它也不完全支持旧版本的 Mac OS(没有桌面版本)。 Trying with just docker machine as follows;尝试使用 docker 机器如下;

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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