Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库、缓存和消息中间件。
一、下载安装
windows版本
https://github.com/microsoftarchive/redis/releases
推荐大家使用linux版本 centos
yum install redis
下载解压即可使用
安装成服务
redis-server.exe --service-install redis.windows-service.conf --loglevel verbose
卸载服务
redis-server --service-uninstall
开启服务
redis-server.exe redis.windows-service.conf
客户端
redis-cli -h 127.0.0.1 -p 6379
配置简介
127.0.0.1 -p 6379
Snapshotting 快照
appendonly no 实时保存
二、安装php扩展
https://github.com/phpredis/phpredis
https://github.com/nrk/predis
https://pecl.php.net/package/redis
5.0.0RC2
三、测试
$redis=new redis();
$redis->connect('127.0.0.1', 6379);
$redis->set("aaa","aaa");
echo $redis->get("aaa");