Redis3.0.5安装

Redis安装

redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多
安装很简单

1
2
3
4
5
[root@XiaoFeng local]wget http://download.redis.io/releases/redis-3.0.5.tar.gz
[root@XiaoFeng local]# tar -zxf redis-3.0.5.gz
[root@XiaoFeng redis-3.0.5]# make
[root@XiaoFeng local]# mv redis-3.0.5 ./redis
[root@XiaoFeng redis]# vim redis.conf

查找daemonize启用后台运行,默认端口号port 6379
将daemonize no改为daemonize yes
启动redis
[root@XiaoFeng redis]# ./src/redis-server redis.conf

为php安装redis扩展phpredis

1
2
3
4
5
[root@XiaoFeng lnmp]#wget https://pecl.php.net/get/redis-2.2.7.tgz
[root@XiaoFeng lnmp]# tar -zxf redis-2.2.7.tgz
[root@XiaoFeng redis-2.2.7]# /usr/local/php/bin/phpize
[root@XiaoFeng redis-2.2.7]# ./configure --with-php-config=/usr/local/php/bin/php-config
[root@XiaoFeng redis-2.2.7]# make && make install

配置PHP加载扩展
[root@XiaoFeng redis-2.2.7]# vim /usr/local/php/etc/php.ini
extension=redis.so
查看phpinfo
连接测试
C:\Users\枫叶>telnet 192.168.1.125 6379

本文出自 “小风博客” BY:小风 如果你喜欢,转载请务必保留此出处^_^
小风博客  http://www.xfphp.cn  小风网络 http://www.hotxf.com