By 31st March 2018 we will deprecate and archive the Homebrew/php tap. Unfortunately we have been unable to maintain an acceptable, consistent user or contributor experience and CI workload through non-core formula taps in the Homebrew organisation so we are continuing to migrate widely used formulae into Homebrew/core and encourage more niche formulae and options to be supported outside the Homebrew organisation.
We deprecated and archived the Homebrew/php tap and created new php and versioned [email protected]* formulae in Homebrew/core. This completes the deprecation and archival of the last non-Homebrew/core tap for end-users. We encourage more niche formulae and options to be supported in taps outside the Homebrew organisation.
首先我要说一下怎么安装扩展,因为发现这个问题就是因为我安装amqp扩展的时候,用brew search amqp,无法查询到类似php71-amqp这样的扩展,于是去网上搜索,发现好多人都说现在不能用brew的方式安装扩展了,要用pecl install amqp这样的方式安装,于是就去查为什么不能用brew的方式安装扩展了,查到的结果就是上面第二点提到的原因,于是我就决定用pecl来安装amqp扩展,可是我从来没用过pecl,都不知道是什么,查了一下发现pecl是“PHP Extension Community Library”,翻译一下就是php扩展库,看pecl install amqp想到pecl肯定是一个命令嘛,我电脑上没有就装一个呗,于是我就想去安装一个pecl,我先用brew查询一下有没有pecl:brew search pecl,结果查询到没有,而且出来一堆像报错一样的信息(认真看了一下其实不是报错),我就想brew怎么没法安装呢,难道要用源码包?于是去网上查,在https://pecl.php.net/ 上才发现The packaging and distribution system used by PECL is shared with its sister, PEAR. 为什么是sister?不是brother?疑惑中。。。然后我又双叒叕去查pear是什么东西,我觉得应该不会是我喜欢吃的雪梨,一查果然不是雪梨,而是“PHP Extension and Application Repository” 翻译一下就是PHP扩展及应用库,现在知道了PEAR是PECL的姐姐,可是我要安装的是PECL啊,到底要怎么安装???网上找了半天,跟这个兄弟一样没找着怎么安装pecl:
最后我尝试重新安装php:brew install php,安装完后,再用pecl install amqp,bingo,成功了!brew services restart php重启一php-fpm就可以在phpinfo里查到有这个扩展了!但我看了一下php.ini,发现果然像网上一个老外说的,It‘s very stupid that the pecl put the extension reference to the top of the php.ini,就是说pecl安装完php的扩展后,确实是会自动住php.ini添加一行启用扩展的语句,即extension=xxxx.so这种,但是这样太傻B了,竟然直接添加到php.ini顶部去了,因为我们都知道,这个语句应该放到php.ini中的这个区域: