重新编译swoole, 启用协程Redis客户端

1:下载安装hiredis库。

wget https://github.com/redis/hiredis/archive/master.zip

unzip master.zip && cd hiredis-master
make && make install
ldconfig
2:重新安装swoole
wget https://github.com/swoole/swoole-src/archive/v2.2.0.tar.gz

tar -zxvf v2.2.0.tar.gz 
cd swoole-src-2.2.0/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-async-redis
在编译时增加--enable-async-redis来开启此功能
make && make install
php --ri swoole

[root@iZuf61 swoole-src-2.2.0]# php --ri swoole
swoole
swoole support => enabled
Version => 2.2.0
Author => tianfeng.han[email: mikan.tenny@gmail.com]
coroutine => enabled
epoll => enabled
eventfd => enabled
timerfd => enabled
signalfd => enabled
cpu affinity => enabled
spinlock => enabled
rwlock => enabled
async redis client => enabled
async http/websocket client => enabled
Linux Native AIO => enabled
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled


Directive => Local Value => Master Value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_namespace => On => On
swoole.use_shortname => On => On
swoole.fast_serialize => Off => Off

swoole.unixsock_buffer_size => 8388608 => 8388608


当出现async redis client => enabled
协程Redis客户端 则为启用了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值