PHP Memcache连接到Couchbase,但无能为力 [英] PHP Memcache connects to couchbase but can't do anything else

查看:72
本文介绍了PHP Memcache连接到Couchbase,但无能为力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上安装了新的CouchBase服务器,并且Apache和PHP和php_memcache.dll的配置正确.我可以连接到服务器,但无法获取统计信息或设置任何值.有什么建议我做错了吗?我已经关闭了防火墙,但是当我可以连接到11211时,我认为连接正常吗?

I have a new CouchBase server set up on Windows 7, and Apache with PHP and php_memcache.dll configured correctly. I can connect to the server, but cannot get stats, or set any values. Any suggestions what I am doing wrong? I've turned the firewall off, but as I can connect to 11211, I think connectivity is OK, anyway?

这是一个测试脚本

$memcache = new Memcache;
$memcache->connect('127.0.0.1', 11211) or die ("Could not connect");
var_dump($memcache);
echo "<hr />";
$allSlabs = $memcache->getExtendedStats('slabs');
var_dump($allSlabs);
echo "<hr />";
$items = $memcache->getExtendedStats('items');
var_dump($items);
echo "<hr />";
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$t = $memcache->set("rule_$uid", $tmp_object, false, 10);
var_dump($t);
exit;

输出

object(Memcache)#3 (1) { ["connection"]=> resource(8) of type (memcache connection) }
------------------------------------
array(1) { ["127.0.0.1:11211"]=> bool(false) }
------------------------------------
array(1) { ["127.0.0.1:11211"]=> bool(false) }
------------------------------------
bool(false)

推荐答案

如果是Couchbase存储桶类型(在安装时可以选择),则不会有统计平板"或统计项目".这就解释了这两个.至于要获取和设置的项目,代码片段中的其他任何地方都没有$ uid,因此在其他地方必须有更多的东西吗?

If it's a Couchbase bucket type (selectable at install time) there would be no "stats slabs" or "stats items". That explains those two. As to the item you're getting and setting, there is no $uid anywhere else in the code snippet, so there must be more to this somewhere else?

这篇关于PHP Memcache连接到Couchbase,但无能为力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆