为了使用SwooleDistributed, 今天安装了Swoole扩展。注意SD框架2.xx系列使用Swoole 1.x.x 版本, SD 3.x.x系列使用
Swoole 2.x.x 版本。这里使用Swoole 1.9.3 稳定版本
1 下载Swoole源码
https://github.com/swoole/swoole-src/releases/tag/v1.9.3-stable
cd swoole
phpize
./configure
make
sudo make install
安装成功之后php.ini文件中加上swoole.so
我编译时的参数包括:
sudo./configure --enable-sockets --enable-openssl --with-php-config=/usr/local/Cellar/php71/7.1.8_20/bin/php-config --enable-swoole-debug --enable-async-redis --prefix=/usr/local CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib"
由于SwooleDistributed 需要使用openssl功能,在编译的时候需要加上参数 --enable_openssl
如果安装的时候出现问题
swoole-src-1.9.3