用brew安装PHP扩展时报错nvalid attribute for formula 'homebrew/php/php71?

发布于 2022-09-06 08:16:44 字数 1784 浏览 7 评论 0

在我重新安装了PHP71后
报错内容如下:
包括安装reids,mongodb扩展也是,任何扩展也装不上。

huangwhMac:php huangwh$ brew install php71-igbinary
Updating Homebrew...
==> Installing php71-igbinary from homebrew/php
Error: invalid attribute for formula 'homebrew/php/php71': version (nil)
/usr/local/Homebrew/Library/Homebrew/formula.rb:252:in `validate_attributes!'
/usr/local/Homebrew/Library/Homebrew/formula.rb:199:in `initialize'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:88:in `new'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:88:in `get_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:275:in `factory'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:33:in `to_formula'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:96:in `block in expand'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:83:in `expand'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1473:in `recursive_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1485:in `runtime_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:416:in `runtime_requirements'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:429:in `expand_requirements'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:364:in `compute_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:136:in `verify_deps_exist'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:129:in `prelude'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:335:in `install_formula'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:226:in `block in install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:224:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:224:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゃ懵逼小萝莉 2022-09-13 08:16:44

1.首先你要确定你已经 brew update 了。
2.其次你可以在命令行运行 brew install php71-igbinary --build-from-source
3.可以在 --build-from-source 后面追加 --HEAD 或者 --devel
4.可能是你的Homebrew 版本过低,尝试重装:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果仍然不行的话,可以@我

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文