您的位置:首页 > 数据库 > Redis

redis的安装及php的redis使用

2016-07-15 09:15 405 查看
yum install phpredis -y

如果使用Centos自带php则确保php-devel安装 否则执行:

yum install php-devel -y (不安装的话无法加载redis扩展)

连接到Redis服务器

//Connecting to Redis server on localhost

redis=newRedis();redis->connect(‘127.0.0.1’, 6379);

result=redis->auth(password);//密码登陆

redis−>select(“5”);//选择库echo“Connectiontoserversucessfully”;//checkwhetherserverisrunningornotecho“Serverisrunning:”.redis->ping();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  redis php centos