【问题标题】:How can I install php7.1 using brew in 2020如何在 2020 年使用 brew 安装 php7.1
【发布时间】:2020-04-08 12:25:26
【问题描述】:

我参考了谷歌的一些教程,但它们不起作用,我猜那些方法已经过时了。

例如https://developerjack.com/blog/2016/installing-php71-with-homebrew/

运行“brew install php@7.1”时出现错误

macOS Catalina 10.15.4

executed
brew install

brew tap
caskroom/cask
homebrew/bundle
homebrew/cask
homebrew/core
homebrew/services
mongodb/brew

brew -v
Homebrew 2.2.12
Homebrew/homebrew-core (git revision 53ccd; last commit 2020-04-08)
Homebrew/homebrew-cask (git revision 322a2; last commit 2020-04-08)

brew install php@7.1
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.

Error: No available formula with the name "php@7.1" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

【问题讨论】:

    标签: php homebrew


    【解决方案1】:

    直到 2018 年 3 月底,所有与 PHP 相关的 brews 都由 Homebrew/php 选项卡处理,但已被弃用,所以现在我们使用 Homebrew/core 包中可用的内容。这应该是一个更好的维护,但它是一组不太完整的包。

    PHP 5.6PHP 7.0PHP 7.1 已被弃用并从 Brew because they are out of support 中删除,而 不推荐用于生产,有正当理由在开发环境中测试这些不受支持的版本。

    请记住,Brew 仅支持 PHP 7.2 到 7.4,因此如果您想安装 PHP 5.6PHP 7.0 >PHP 7.1 你需要添加这个水龙头:

    $ brew tap exolnet/homebrew-deprecated
    

    Reference here

    【讨论】:

    • 2021 年更新:已弃用自制软件的 repo 已……弃用。使用 shivammathur/php 代替旧版 PHP 安装。
    【解决方案2】:

    PHP@7.1 已弃用 https://www.php.net/supported-versions.php

    所以尝试使用其他 repo 安装

    brew install openldap libiconv
    brew tap exolnet/homebrew-deprecated
    brew install php@7.1
    

    https://devhoi.com/threads/install-brew-deprecated-php-version-php-7-1-5-6-7-0-on-brew-macos.25/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-13
      • 2013-12-29
      • 2017-12-29
      • 2018-02-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多