TsAihS

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

------ redis安装,启动服务,开机启动,打开redis客户端 ------

yum install -y redis

systemctl start redis

systemctl enable redis

redis-cli

 

------ 安装phpredis ------

 

pecl install redis-2.2.3

extension_dir = "/usr/lib64/php/modules/"

extension=redis.so 

 

------ 测试 ------

<?php
   //Connecting to Redis server on localhost
   $redis = new Redis();
   $redis->connect('127.0.0.1', 6379);
   echo "Connection to server sucessfully";
   //check whether server is running or not
   echo "Server is running: " . $redis->ping();
?>

 

posted on 2016-09-03 14:21  TsAihS  阅读(172)  评论(0编辑  收藏  举报