redis 安装
redis 2.8.17 安装
环境:centos6.3x64
依赖tcl安装
[root@fxzy-web redis]# cd /root [root@fxzy-web ~]# wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz [root@fxzy-web ~]# tar zxvf tcl8.6.1-src.tar.gz [root@fxzy-web ~]# cd tcl8.6.1/unix [root@fxzy-web unix]# ./configure --prefix=/usr --without-tzdata --mandir=/usr/share/man [root@fxzy-web unix]# make [root@fxzy-web unix]# sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" -i tclConfig.sh [root@fxzy-web unix]# make install && make install-private-headers && ln -v -sf tclsh8.6 /usr/bin/tclsh && chmod -v 755 /usr/lib/libtcl8.6.so [root@jiaomai unix]# cd /root
redis 安装
[root@fxzy-web root]# wget http://download.redis.io/releases/redis-2.8.17.tar.gz [root@fxzy-web root]# tar zvxf /root/redis-2.8.14.tar.gz [root@fxzy-web redis-2.8.17]# cd redis [root@fxzy-web redis-2.8.17]# make [root@fxzy-web redis-2.8.17]# make test [root@fxzy-web redis-2.8.17]# mkdir /usr/local/redis [root@fxzy-web redis-2.8.17]# cp redis.conf /usr/local/redis/ [root@fxzy-web redis-2.8.17]# cd /usr/local/bin [root@fxzy-web bin]# mv redis-* /usr/local/redis [root@fxzy-web redis]# ln -s /usr/local/redis/redis.conf /etc/redis.conf //创建软文链接 可以不创建 [root@fxzy-web redis]# vim redis.conf daemonize yes #修改为后台 [root@fxzy-web redis]# vim /etc/sysctl.conf vm.overcommit_memory = 1 #在最后一行添加 [root@fxzy-web redis]# sysctl -p
phpredis 扩展安装
下载地址 https://github.com/nicolasff/phpredis
[root@fxzy-web ~]# unzip phpredis-master.zip [root@fxzy-web /]# cd /root/phpredis-master [root@fxzy-web phpredis-master]# /usr/local/php/bin/phpize [root@fxzy-web phpredis-master]# ./configure --with-php-config=/usr/local/php/bin/php-config [root@jiaomai phpredis-master]# make && make install [root@jiaomai phpredis-master]# mv /usr/local/php/lib/php/extensions/no-debug-zts-20090626/* /usr/local/php/ext/
测试
[root@jiaomai ~]# cd /usr/local/redis/ [root@jiaomai redis]# ./redis-server redis.conf [root@jiaomai redis]# ./redis-cli 127.0.0.1:6379> keys * (empty list or set) 127.0.0.1:6379> set abc 'abc' OK 127.0.0.1:6379> get abc "abc"
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04