##Ubuntu版本:
1.安装命令:
# sudo apt-get update# sudo apt-get install redis-server复制代码
2.启动:
# redis-server复制代码
**注意:有事后会出现Warning的提示:配置文件未配置
3.继续查看redis是否启动
# redis-cli复制代码
**如果出现以下,说明成功:
4.输入PING命令
ping复制代码
效果如下:
##windows 安装(不推荐,因为下了老半天居然失败...)https://github.com/MSOpenTech/redis/releases
打开cmd 命令窗口,切换到你安装的redis 的路径,运行
运行 redis-server.exe redis.windows.conf 复制代码
新建一个窗口 运行 redis-cli.exe -h 127.0.0.1 -p 6379 这样就可以设置你的 key 和 value 了。
######设置redis 的最大占用内存 Redis 设置最大占用内存,打开配置文件,设置maxmemory参数, 注意 maxmemory 是bytes字节类型。 如果不设置或者将maxmemory设置为0的话,64位系统不限制内存,32位系统最多使用3GB内存。
# In short... if you have slaves attached it is suggested that you set a lower# limit for maxmemory so that there is some free RAM on the system for slave# output buffers (but this is not needed if the policy is 'noeviction').## maxmemorymaxmemory 268435456复制代码
###php 相关插件 https://github.com/phpredis/phpredis/downloads
http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/