swoole1.8.0+版本异步redis安装(本实例为swoole1.8.10版本)详解
来源:互联网 发布:阿里云好还是腾讯云好 编辑:程序博客网 时间:2024/06/05 14:07
Swoole-1.8.0+版本增加了对异步Redis客户端的支持,基于redis官方提供的hiredis库实现。Swoole提供了__call魔术方法,来映射绝大部分Redis指令(本次安装实例为swoole1.8.10版本)
编译安装hiredis (swoole1.8.10版本异步redis支持必须环境条件)
使用Redis客户端,需要安装hiredis库。下载hiredis源码后,执行
make -j
sudo make install
sudo ldconfig (编译安装完记得执行该命令,否则PHP在引入swoole扩展时将出现类似如下红色字体部分错误)
PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/swoole.so' - libhiredis.so.0.13: cannot open shared object file: No such file or directory in Unknown on line 0
hiredis下载地址:https://github.com/redis/hiredis (https://github.com/redis/hiredis/releases)
启用异步Redis客户端
编译swoole是,在configure指令中加入--enable-async-redis
./configure --enable-async-redis
make clean
make -j
sudo make install
编译安装hiredis (swoole1.8.10版本异步redis支持必须环境条件)
使用Redis客户端,需要安装hiredis库。下载hiredis源码后,执行
make -j
sudo make install
sudo ldconfig (编译安装完记得执行该命令,否则PHP在引入swoole扩展时将出现类似如下红色字体部分错误)
PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/swoole.so' - libhiredis.so.0.13: cannot open shared object file: No such file or directory in Unknown on line 0
hiredis下载地址:https://github.com/redis/hiredis (https://github.com/redis/hiredis/releases)
启用异步Redis客户端
编译swoole是,在configure指令中加入--enable-async-redis
./configure --enable-async-redis
make clean
make -j
sudo make install
因为这里用到了swoole的更多扩展组件(ssl 、debug等),所以 摘取天上星 的实际编译命令如下:
./configure --enable-async-redis --with-php-config=/usr/local/php/bin/php-config --enable-openssl --enable-swoole-debug --enable-sockets --enable-ringbuffer --enable-swoole
swoole的./configure有很多额外参数,可以通过./configure --help命令查看,这里均选择默认项)
安装完成后,进入/usr/local/php/etc目录下,打开php.ini文件,在其中加上如下一句:
extension=swoole.so
随后在终端中输入命令 php -m 查看扩展安装情况(或通过phpinfo()函数查看)。如果在列出的扩展中看到了swoole,则说明安装成功。
0 0
- swoole1.8.0+版本异步redis安装(本实例为swoole1.8.10版本)详解
- 安装redis版本为1.2.6
- 靠谱版Ubuntu安装最新版本 redis
- Linux - Redis介绍以及安装 (简易版本)
- redis安装配置-3.2.6版本
- Redis安装(CentOs版本),及项目引用
- PHP5.6版本安装redis扩展
- 【EmbeddedDev】升级gcc到4.8版本(旧版本为4.6)
- ubuntu多版本python为指定版本python安装库
- MySQL 5.6.21版本安装实例
- 如何为ubuntu server 版本 安装图形界面
- C#读取本机安装的.net framework 版本
- linux下python安装其他版本替换之前旧版本
- API判断本机安装的Revit版本信息
- 获取本机安装的Revit版本信息
- 本机安装多个版本的protoc
- Openmeetings 1.8版本Windows安装详解
- 最新版本gcc5.3安装详解
- Java 之EnumSet与EnumMap
- 浅谈ssh(spring+struts+hibernate)框架的搭建
- nginx使用zookeeper造成进程死锁和崩溃问题和解决方案
- 序列化与反序列化 Socket中处理方法
- 单例模式详解
- swoole1.8.0+版本异步redis安装(本实例为swoole1.8.10版本)详解
- 设置Android studio 禁用sdk检查更新
- VS2015使用小技巧 查看值类型int与引用类型string在栈中的地址、堆中的地址
- H5 canvas绘图描边小细节
- 单例模式三种模式,饿汉、饱汉、双重锁模式,实例及优劣详解
- cannot import name imread
- 移动端meta常用参数
- Cygwin (64-bit)绿色版
- 关于Android adb 调试程序解决小米MIUI的INSTALL_FAILED_UPDATE_INCOMPATIBLE的安装错误