簡體   English   中英

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

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

我曾嘗試使用 MacOS High Sierra 在我的 iMac 上更新 PHP,但我找不到方法。 我打算運行 Laravel 7。我的 MacOS 版本是否與最新版本的 PHP 兼容?

我當前的 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$ 

與我在此處回答的類似,您需要一些環境設置才能使其對您有利:

  • 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"

現在你仍然可以使用 php@7.3 的瓶子,但它可能會在下一個版本中消失,因為 homebrew 最近放棄了高山脈瓶子支持

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM