简体   繁体   English

我可以使用 macOS High Sierra 更新到最新版本的 PHP

[英]Can i update to the latest version of PHP with macOS High Sierra

I have tried to update PHP on my iMac with MacOS High Sierra, but I can't find how to do it.我曾尝试使用 MacOS High Sierra 在我的 iMac 上更新 PHP,但我找不到方法。 I intend to run Laravel 7. Is my MacOS version compatible with the most recent version of PHP?我打算运行 Laravel 7。我的 MacOS 版本是否与最新版本的 PHP 兼容?

My current PHP version is the following:我当前的 PHP 版本如下:

Last login: Wed Nov 18 17:19:54 on ttys000
Albert-iMac:~ admin$ php -v
PHP 7.1.33 (cli) (built: Jan 18 2020 13:49:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
Albert-iMac:~ admin$ brew install php@7.3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
aerc            cargo-edit      cfn-format      giza            gping
==> Updated Formulae
Updated 124 formulae.

Warning: php@7.3 7.3.24 is already installed and up-to-date
To reinstall 7.3.24, run `brew reinstall php@7.3`
Albert-iMac:~ admin$ 

Similar to what I have answered in here , you need some environment setup to have it work for your favor:与我在此处回答的类似,您需要一些环境设置才能使其对您有利:

  • brew install php@7.3
  • brew link --force php@7.3
  • brew services start php@7.3
  • export PATH="/usr/local/opt/php@7.3/bin:$PATH"
  • export PATH="/usr/local/opt/php@7.3/sbin:$PATH"

Right now you can still have the bottle for php@7.3, but it might go away with the next release as homebrew dropped the high-sierra bottle support recently.现在你仍然可以使用 php@7.3 的瓶子,但它可能会在下一个版本中消失,因为 homebrew 最近放弃了高山脉瓶子支持

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

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