编译安装hiredis
在redis的发行包中的deps目录中就包含hiredis的源码,手动编译安装,或者自行下载一份。地址:https://github.com/redis/hiredis
wget https://github.com/redis/hiredis/archive/v0.13.3.tar.gz
tar v0.13.3.tar.gz
C/C++ Code复制内容到剪贴板
- make -j
- sudo make install
- sudo ldconfig
启用异步Redis客户端
编译swoole时,在configure
指令中加入--enable-async-redis
C/C++ Code复制内容到剪贴板
- wget https://gitee.com/login?url_to=/swoole/swoole/repository/archive/v2.1.2.zip
- ## apt install zip 如果没装的话
- zip v2.1.2.zip
- cd swoole
- phpize
- ./configure --enable-async-redis
- make clean
- make -j
- sudo make install
C/C++ Code复制内容到剪贴板
- cd /deps/hiredis
- make
- make install
- mkdir /usr/lib/hiredis
- cp libhiredis.so /usr/lib/hiredis //将动态连接库libhiredis.so至/usr/lib/hiredis
- mkdir /usr/include/hiredis
- cp hiredis.h /usr/include/hiredis //头文件包含#include<hiredis/hiredis.h>
上一篇 swoole扩展安装
下一篇 常见错误