安装swoole
1、下载swoole安装包、官网https://www.swoole.com/
git clone https://github.com/swoole/swoole-src.git
cd swoole-src
2、 php7.1以下版本 需要检出bbb49bf版本
git checkout bbb49bf
3、编译安装
phpize
./configure --enable-swoole-debug
make && make install
4、等待安装,直到提示如下信息
Installing shared extensions: /usr/local/php7/lib/php/extensions/debug-non-zts-20151012/
5、在php配置中添加扩展
extension=swoole.so。
6、重启php-fpm,输入命令php -v
检查swoole扩展是否加载成功
安装问题:
1、WARNING: unrecognized options: –enable-async-mysql
1.8.7或更高版本不再需要设置–enable-async-mysql和–enable-async-httpclient,async_mysql和async_httpclient改为内置