Menu Close

Redis 安装部署

wget http://download.redis.io/releases/redis-3.0.7.tar.gz
tar xvf redis-3.0.7.tar.gz
cd redis-3.0.7
make
cd src
make test 报错

You need tcl 8.5 or newer in order to run the Redis test

wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/
cd /usr/local/tcl8.6.1/unix/
sudo ./configure
sudo make
sudo make install

cd /usr/local/redis/redis-3.0.7/src
make test
make install

安装完成后
cp ../redis.conf /etc/redis.conf
nohup /usr/local/redis/redis-3.0.7/src/redis-server /etc/redis.conf

————————————————————————————————
至此 redis 服务已经安装成功,还需要将 redis 加载到 php 中。

wget https://github.com/nicolasff/phpredis/zipball/master -O php-redis.zip
unzip php-redis.zip
解压后目录是:nicolasff-phpredis-21d6614
cd nicolasff-phpredis-21d6614
phpize (如果没有 phpize,yum install php-devel)
./configure
make
make install
配置文件加入 extension=redis.so,以启用redis extension
重启服务
service nginx restart
service php-fpm restart

发表评论

邮箱地址不会被公开。 必填项已用*标注

沪ICP备14006760号-2