$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/homebrew-php
//安装PHP7
$ brew install php70
//删掉旧版本,我以前安装的是PHP5.6
$ brew unlink php56
$ brew link php70
//完成
$ php -v
PHP 7.0.0 (cli) (built: Dec 2 2015 13:06:23) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
$ //下载
$ wget http://pecl.php.net/get/yaf-3.0.2.tgz
$ tar zxvf yaf-3.0.2.tgz
$ cd yaf-3.0.2
$ //编译
$ /usr/local/opt/php70/bin/phpize
$ ./configure --with-php-config=/usr/local/opt/php70/bin/php-config
$ make && make install
$ Installing shared extensions: /usr/local/Cellar/php70/7.0.5/lib/php/extensions/no-debug-non-zts-20151012/
$ cd ..
//下载
$ wget -c https://github.com/phpredis/phpredis/archive/php7.zip
$ unzip php7.zip
$ cd phpredis-php7
//编译
$ /usr/local/opt/php70/bin/phpize
$ ./configure --with-php-config=/usr/local/opt/php70/bin/php-config
$ make
$ make install
$ cd ..
//brew install
$ brew install --HEAD homebrew/php/php70-memcached
//源码编译
$ wget https://github.com/websupport-sk/pecl-memcache/archive/php7.zip
$ unzip php7.zip
$ cd pecl-memcache
$ /usr/local/opt/php70/bin/phpize
$ ./configure --with-php-config=/usr/local/opt/php70/bin/php-config
$ make && make install
//下载
$ wget -c https://github.com/swoole/swoole-src/archive/swoole-1.7.21-stable.tar.gz
$ tar zxvf swoole-1.7.21-stable.tar.gz
$ cd swoole-src-swoole-1.7.21-stable/
//编译
$ /usr/local/opt/php70/bin/phpize
$ ./configure --with-php-config=/usr/local/opt/php70/bin/php-config
$ make
$ make install
$ cd ..
mkdir -p /usr/local/etc/php/7.0/conf.d
cd /usr/local/etc/php/7.0/conf.d
vim cat ext-yaf.ini
[memcache]
extension="/usr/local/Cellar/php70/7.0.5/lib/php/extensions/no-debug-non-zts-20151012/yaf.so"
依次添加
...