1. <small id='6R5FL'></small><noframes id='6R5FL'>

      <i id='6R5FL'><tr id='6R5FL'><dt id='6R5FL'><q id='6R5FL'><span id='6R5FL'><b id='6R5FL'><form id='6R5FL'><ins id='6R5FL'></ins><ul id='6R5FL'></ul><sub id='6R5FL'></sub></form><legend id='6R5FL'></legend><bdo id='6R5FL'><pre id='6R5FL'><center id='6R5FL'></center></pre></bdo></b><th id='6R5FL'></th></span></q></dt></tr></i><div id='6R5FL'><tfoot id='6R5FL'></tfoot><dl id='6R5FL'><fieldset id='6R5FL'></fieldset></dl></div>

      <legend id='6R5FL'><style id='6R5FL'><dir id='6R5FL'><q id='6R5FL'></q></dir></style></legend>
        <bdo id='6R5FL'></bdo><ul id='6R5FL'></ul>

      <tfoot id='6R5FL'></tfoot>

        连接到 Redis 以使用 PHP

        时间:2023-10-04

            <legend id='CTqVY'><style id='CTqVY'><dir id='CTqVY'><q id='CTqVY'></q></dir></style></legend>
          • <tfoot id='CTqVY'></tfoot>
          • <small id='CTqVY'></small><noframes id='CTqVY'>

              <tbody id='CTqVY'></tbody>

              • <bdo id='CTqVY'></bdo><ul id='CTqVY'></ul>
                1. <i id='CTqVY'><tr id='CTqVY'><dt id='CTqVY'><q id='CTqVY'><span id='CTqVY'><b id='CTqVY'><form id='CTqVY'><ins id='CTqVY'></ins><ul id='CTqVY'></ul><sub id='CTqVY'></sub></form><legend id='CTqVY'></legend><bdo id='CTqVY'><pre id='CTqVY'><center id='CTqVY'></center></pre></bdo></b><th id='CTqVY'></th></span></q></dt></tr></i><div id='CTqVY'><tfoot id='CTqVY'></tfoot><dl id='CTqVY'><fieldset id='CTqVY'></fieldset></dl></div>
                  本文介绍了连接到 Redis 以使用 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我是 Redis 的新手...我最近才开始学习 Redisent 来使用 RedisPHP...而且我玩得很开心!但是,我注册了 Redis to go 服务,并且一直在努力连接以使用该服务..

                  I am a newbie with Redis...I just recently picked up Redisent to work with Redis in PHP...and I am having tons of fun! However, I signed up for the Redis to go service, and have been beating my head to connect to use the service...

                  URI 字符串如下:

                  redis://[用户名]:[pass]@[server].redistogo.com:[端口]/

                  redis://[username]:[pass]@[server].redistogo.com:[port]/

                  Redisent 客户端只是接收主机名和端口...而我没有地方输入用户名/密码... :-/我也一直在摆弄 fsockopen() 函数...但没有分数.

                  The Redisent client simply takes in the hostname and the port...and there's no place for me to enter the username/password... :-/ I've been fiddling around with the fsockopen() function, too...but no score.

                  有没有人尝试连接到 Redis 以使用 PHP?如果是这样,任何见解或指示将不胜感激!

                  Has anyone tried connecting to Redis to go with PHP? If so, any insights or pointers would be greatly appreciated!

                  注意:我意识到有一个 REST API 可用,但那是用于配置实例,而不是用于 GET/SET 等实际操作.

                  Note: I realize that there is a REST API available, but that's for provisioning instances, not for the actual operations such as GET/SET,etc.

                  推荐答案

                  predis 是首选库(积极开发 => 2011 年 1 月 6 日) 使用.

                  predis is the prefered library(active development => 6 Januari 2011) to use.

                  redis://$x:$y@$z
                  

                  然后你需要下面的代码来让它工作(我测试过):

                  Then you need the following code to get it working(I tested it):

                  <?php
                  
                  require('./Predis.php');
                  
                  #redis://$x:$y@$z
                  $redis   = new PredisClient('redis://$z');
                  $redis->auth($y);
                  $redis->incr('counter');
                  echo $redis->get('counter');
                  echo "
                  ";
                  

                  奇怪的是$x.根本不需要?

                  The strange thing is $x. It is not needed at all?

                  这篇关于连接到 Redis 以使用 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用Redis在NodeJs和PHP之间共享会话? 下一篇:在 Laravel 中取消作业

                  相关文章

                  最新文章

                  1. <tfoot id='kchp9'></tfoot>
                    <i id='kchp9'><tr id='kchp9'><dt id='kchp9'><q id='kchp9'><span id='kchp9'><b id='kchp9'><form id='kchp9'><ins id='kchp9'></ins><ul id='kchp9'></ul><sub id='kchp9'></sub></form><legend id='kchp9'></legend><bdo id='kchp9'><pre id='kchp9'><center id='kchp9'></center></pre></bdo></b><th id='kchp9'></th></span></q></dt></tr></i><div id='kchp9'><tfoot id='kchp9'></tfoot><dl id='kchp9'><fieldset id='kchp9'></fieldset></dl></div>

                        <bdo id='kchp9'></bdo><ul id='kchp9'></ul>
                    1. <small id='kchp9'></small><noframes id='kchp9'>

                    2. <legend id='kchp9'><style id='kchp9'><dir id='kchp9'><q id='kchp9'></q></dir></style></legend>