ubuntu下安装php redis
生活随笔
收集整理的這篇文章主要介紹了
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');
轉載于:https://www.cnblogs.com/skillCoding/archive/2012/04/05/2433123.html
總結
以上是生活随笔為你收集整理的ubuntu下安装php redis的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: lisp中的*,**,***
- 下一篇: php页面缓存