【问题标题】:Can i update to the latest version of PHP with macOS High Sierra我可以使用 macOS High Sierra 更新到最新版本的 PHP
【发布时间】:2021-03-01 23:15:15
【问题描述】:

我尝试在 iMac 上使用 MacOS High Sierra 更新 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$ 

【问题讨论】:

    标签: php macos installation homebrew


    【解决方案1】:

    与我在 here 中的回答类似,您需要一些环境设置才能让它为您服务:

    • 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 dropped the high-sierra bottle support 的下一个版本中消失。

    【讨论】:

    • 谢谢“@chenrui 我已经这样做了并且正在工作。
    猜你喜欢
    • 2020-03-04
    • 2018-03-08
    • 2018-04-01
    • 2022-12-22
    • 1970-01-01
    • 1970-01-01
    • 2018-02-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多