【问题标题】:Error with brew install php@7.4. I cannot solve unexpected /Formula/php.rb error?brew install php@7.4 出错。我无法解决意外的 /Formula/php.rb 错误?
【发布时间】:2020-09-10 21:44:53
【问题描述】:

当我运行brew install php@7.4 时,出现以下错误。

Error: php@7.4: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/php@7.4:1: syntax error, unexpected ..
../Formula/php.rb
^~
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Aliases/php@7.4:1: unknown regexp options - php
ALT01979:Homebrew hc641j$ 
brew install php@7.4.10

在下面给出这个错误。

Error: No available formula with the name "php@7.4.10" 
==> 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 时它可以工作,但我需要专门安装 7.4。

【问题讨论】:

标签: php homebrew


【解决方案1】:

homebrew-core 没有 php@7.4 的别名,这就是为什么你不能使用brew install php@7.4,但你应该可以使用brew install php 来安装 php 7.4.10

版本检查测试:

$ php --version
PHP 7.4.10 (cli) (built: Sep  3 2020 18:19:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.10, Copyright (c), by Zend Technologies

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-29
    • 1970-01-01
    • 2012-08-15
    相关资源
    最近更新 更多