Homebrew/php自来水在2018年3月尾被弃用,并将所有PHP公式转移到Homebrew/core,旧的brew tap homebrew/dupes、brew tap homebrew/versions、brew tap homebrew/homebrew-php都会报以下缺点:
Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
看到这条心直接凉半截,再也不能用brew install php72-redis愉快地玩耍啦,无奈只好另谋其它办法。
(图片来自网络侵删)还好有位大神给出的办理办法如下:
redis的安装
參考 https://github.com/phan/phan/wiki/Getting-Started#from-homebrew因 homebrew/php 已在 1.5 版併入 homebrew/core
以是须先移除旧版,然后安装新版,再用pecl安装:
brew update; # updates local brew meta data
# removes old homebrew php TAP, now php is in homebrew core
brew untap homebrew/php;
brew uninstall php; # or brew uninstall php72 if you had that before
brew upgrade; # make sure all the other libs are up to date
brew cleanup; # cleanup old files
brew prune; # cleanup old symlinks
brew install autoconf; # Required by pecl
brew install php;
pecl install redis;
经由我的实践此方法是可行的,我是直接用了末了一个命令安装成功的,大家可以根据自己的情形实行。
memcache的安装
php7安装http://pecl.php.net/package/memcache下的任何一款扩展都会报错的,以是大家就不要考试测验了。
这里推举:Github的pecl-memcache分支版本
下载地址:https://github.com/websupport-sk/pecl-memcache/archive/php7.zip
1、便是我们熟习的编译安装
unzip pecl-memcache-php7.zip
cd pecl-memcache-php7
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
2、修正php.ini,加载memcache
extension_dir = "/usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012/"
extension = "memcache.so"
末了重启PHP,大家试试是不是大功告成啦。