win下redis wget http://download.redis.io/releases/redis-3.0.2.tar.gz tar xzf redis-3.0.2.tar.gz cd redis-3.0.2 make cd src mkdir /usr/redis cp redis-server /usr/redis cp redis-benchmark /usr/redis cp redis-cli /usr/redis cd ../ cp redis.conf /usr/redis cd /usr/redis ./redis-server redis.conf =====启动 ./redis-cli 127.0.0.1:6379> keys * (empty list or set) 127.0.0.1:6379> set key "hello world" OK 127.0.0.1:6379> get key "hello world" 127.0.0.1:6379> #修改daemonize为yes,即默认以后台程序方式运行(还记得前面手动使用&号强制后台运行吗)。 daemonize no #可修改默认监听端口 port 6379 #修改生成默认日志文件位置 logfile "/home/futeng/logs/redis.log" #配置持久化文件存放位置 dir /home/futeng/data/redisData
1、phpredis下载地址:http://pecl.php.net/package/redis
wget http:
//pecl
.php.net
/get/redis-2
.2.5.tgz
2、解压安装,安装方法在 https://github.com/nicolasff/phpredis/#installation
tar
xzf redis-2.2.5.tgz
cd
redis-2.2.
生成configure配置文件
/usr/local/php/bin/phpize
Configuring
for
:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
.
/configure
--with-php-config=
/usr/local/php/bin/php-config
make
make install
3、配置PHP加载扩展
extension=redis.so
4、查看phpinfo
重启
1. 停止nginx
/usr/local/nginx/sbin/nginx -s stop
2.停止并重启php-fpm
pkill php-fpm /usr/local/php/sbin/php-fpm
3.启动nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ps:若仅仅修改了nginx的配置文件,则不需重启php-fpm,则只需平滑重启nginx即可:
/usr/local/nginx/sbin/nginx -s reload
原文地址:http://dabaobei.blog.51cto.com/9784564/1662815