码迷,mamicode.com
首页 > Web开发 > 详细

安装phpredis扩展以及phpRedisAdmin工具

时间:2014-08-24 23:44:13      阅读:330      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   io   strong   ar   div   

先从phpredis的git拿到最新的源码包:
wget https://github.com/nicolasff/phpredis/archive/master.tar.gz
 
然后解压到进入目录:
tar xvf master.tar.gz
cd phpredis-master
 
编译,安装扩展:
phpize
./configure --enable-redis
make && make install
 
然后编辑php.ini加入 Extensions=redis.so
重启服务器发现php提示缺少redis.so,按照提示的目录把redis.so 拷贝过去就OK了.

phpRedisAdmin是一个在线管理redis的web工具,基于PHP完成.
安装也非常简单,进入web目录
git clone https://github.com/ErikDubbelboer/phpRedisAdmin.git
cd phpRedisAdmin/
cat README.markdown
git submodule init
git submodule update
 
然后就可以通过网址访问了.看一下config.inc.php的简单配置
‘servers‘ => array(
                        0 => array(
                                ‘name‘ => ‘local server‘, // Optional name.
                                ‘host‘ => ‘127.0.0.1‘,
                                ‘port‘ => 6379,
                                ‘filter‘ => ‘*‘

                                // Optional Redis authentication.
                                ),
 
这里是一些简单的redis服务配置.
phpRedisAdmin默认是可以匿名登录的.如果要设置 需要在config里加上
‘login‘ => array(
                                        // Username => Password
                                        // Multiple combinations can be used
                                        ‘admin‘ => array(
                                                ‘password‘ => ‘adminpassword‘,
                                                ),
                                        ‘guest‘ => array(
                                                ‘password‘ => ‘‘,
                                                ‘servers‘ => array(1) // Optional list of servers this user can access.
                                                )
                                        ),

 

下载predis(redis客户端: Predis、phpredis、Rediska、Redisent、iRedis,这里我用的是predis,只要放在phpredisadmin下面即可):https://github.com/nrk/predis/downloads

 

[root@localhost ~]# mv predis/* /usr/local/apache2/htdocs/phpredisadmin/predis/

 

安装phpredis扩展以及phpRedisAdmin工具

标签:style   blog   http   color   os   io   strong   ar   div   

原文地址:http://www.cnblogs.com/kezf/p/phpredis.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!