标签:
1、安装redis
下载:https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
上传phpredis-2.2.4.tar.gz到/usr/local/src目录
cd /usr/local/src #进入软件包存放目录
tar zxvf phpredis-2.2.4.tar.gz #解压
cd phpredis-2.2.4 #进入安装目录
/usr/local/php/bin/phpize #用phpize生成configure配置文件
./configure --with-php-config=/usr/local/php/bin/php-config #配置
make #编译
make install #安装
安装完成之后,出现下面的安装路径
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
2、配置php支持
vi /usr/local/php/etc/php.ini #编辑配置文件,在最后一行添加以下内容
添加
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/redis.so
:wq! #保存退出
3.重启fpm-fastcgi服务sudu /etc/init.d/php-fpm restart
一下安装redis服务
Download, extract and compile Redis with:
$ wget http://download.redis.io/releases/redis-3.0.0.tar.gz
$ tar xzf redis-3.0.0.tar.gz
$ cd redis-3.0.0
$ make
The binaries that are now compiled are available in the src
directory. Run Redis with:
$ src/redis-server
You can interact with Redis using the built-in client:
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
标签:
原文地址:http://www.cnblogs.com/doubilaile/p/4591458.html