PHP 使用 brew php71 成为 php@7.1 后,SNMP 扩展消失了

PHP SNMP extension is gone after php71 became php@7.1 with brew

在 Brew,他们以某种方式将 php 移至 Core https://github.com/Homebrew/homebrew-php/commit/ab5fffa7cf3b7dca77f2ffa6f6104fc09fd72221#diff-188d1e1be1dc7f3dea4ef64559d30f58

但是,现在缺少 SNMP 扩展。如何安装?

http://formulae.brew.sh/formula/php71-snmp 表示公式已删除
http://formulae.brew.sh/formula/php72-snmp 对 php 7.2

说同样的话

根据SMillerDev,这个扩展现在编译成PHP。

yes, the extensions are now compiled into PHP instead of shared. So you need to remove the config files for the old shared extensions.

如你所知,he also said:

SNMP was excluded from the build because it crashes Apache.

但目前 hombebrew-core 中没有关于此的未决问题。

万一有人和我一样苦苦挣扎,但仍然想使用 Homebrew,这就是我所做的:这是一种解决方法,但至少在 Homebrew 正确解决问题之前它是有效的。

分叉https://github.com/Homebrew/homebrew-php/

将 fork 的 master 分支重置为最新的工作提交 5c90bd4 并强制推送到 GitHub

上的远程主机

重置Homebrew/homebrew-php

brew untap homebrew/homebrew-php

点击你的叉子

brew tap <your github username>/homebrew-php

之后当你 运行 brew search php 你会看到所有好的 ol' php 版本和扩展都可用。

或者您可以使用我创建的 Issue 中的水龙头 https://github.com/kabel/homebrew-php-ext as the guy 放在一起