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();
如果使用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();
相关文章推荐
- 一个关于if else容易迷惑的问题
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- Centos6 编译安装Python
- JSP/PHP基于Ajax的分页功能实现
- redis安装问题小结
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- 什么是设计模式
- 硬盘安装CentOS 6.2以及添加GRUB启动菜单
- CentOS 6.2实战部署Nginx+MySQL+PHP
- PHP数据库长连接mysql_pconnect的细节
- CentOS 7系统配置上的变化解析
- Php Installing An Expansion
- rem : web app适配的秘密武器
- jquery高级应用之Deferred对象
- 关于浮动与清除浮动,你应该知道的