ubuntu下安装php redis



ubuntu下安装php redis

sudo apt-get install redis-server

测试redis是否安装成功:
注意:要开启redis
redis-cli
set test hello
OK
get test
"bar"

下载phpredis
sudo wget http://open.imop.us/pr.tar.gz

tar zxvf pr.tar.gz

cd phpredis

phpize //这个phpize是安装php模块的

如果没有phpize,则需要先安装php5-dev

./configure

make

make install

修改php.ini文件
extension=redis.so

重启apache

 

demo:

$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello world!');
echo $redis->get('test');




免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM