问题:如何理解CouchBase与PHP的连接

问题:如何理解CouchBase与PHP的连接,php,couchbase,Php,Couchbase,我刚刚为XAMPP安装了CouchBase和.dll文件。我以他们为例介绍如何连接:“Hello Couchbase” 此代码: $bucketName = "default"; // Connect to Couchbase Server $cluster = new CouchbaseCluster("couchbase://127.0.0.1"); $bucket = $cluster->openBucket($bucketName); 给我: LCB_身份验证错误:身份验证失败

我刚刚为XAMPP安装了CouchBase和.dll文件。我以他们为例介绍如何连接:“Hello Couchbase”

此代码:

$bucketName = "default";

// Connect to Couchbase Server
$cluster = new CouchbaseCluster("couchbase://127.0.0.1");
$bucket = $cluster->openBucket($bucketName);
给我: LCB_身份验证错误:身份验证失败。您可能提供了无效的用户名/密码组合

我有一个新的装置,按照他们的指南#1,我做错了什么?我不记得设置了密码,我去了CouchBase管理员页面,我找不到更改任何密码的方法

我在这里表示同情——我也犯了同样的错误(不,不是你,文档被忽略了)。实例化
CouchbaseCluster
不会抛出错误,实际上是
openBucket()
方法导致了问题,对我来说,问题是bucket不存在(如果Couchbase错误在正确的范围内而不是在不相关的混乱中蹒跚而行就好了)。下面是一些对我有用的代码:

$cluster = new CouchbaseCluster('http://127.0.0.1:8091');
$manager = $cluster->manager('MYUSER', 'MYPASSWORD');
$manager->createBucket('new_bucket');
这确实会引发一些错误:

[cb,WARN] (htconfig L:130 I:0) <couchbase:8091> (CTX=0x5601e6fd7e90,bc_http) Got 404 on config stream. Assuming terse URI not supported on cluster
[cb,EROR] (htconfig L:122 I:0) <couchbase:8091> (CTX=0x5601e6fd7e90,bc_http) Got 404 on config stream. Assuming bucket does not exist as we've tried both URL types
[cb,EROR] (htconfig L:142 I:0) <couchbase:8091> (CTX=0x5601e6fd7e90,bc_http) Got non-success HTTP status code 404
[cb,WARN](htconfig L:130 I:0)(CTX=0x5601e6fd7e90,bc_http)在配置流中获得404。假设集群上不支持简洁的URI
[cb,EROR](htconfig L:122 I:0)(CTX=0x5601e6fd7e90,bc_http)在配置流上获得404。假设bucket不存在,因为我们已经尝试了这两种URL类型
[cb,EROR](htconfig L:142 I:0)(CTX=0x5601e6fd7e90,bc_http)未成功获取http状态代码404
但它确实有效。Couchbase论坛对于这类问题来说是一个更好的地方——它们在那里反应非常快。

我在这里表示同情——我也有同样的错误(不,不是你,文档被忽略了)。实例化
CouchbaseCluster
不会抛出错误,实际上是
openBucket()
方法导致了问题,对我来说,问题是bucket不存在(如果Couchbase错误在正确的范围内而不是在不相关的混乱中蹒跚而行就好了)。下面是一些对我有用的代码:

$cluster = new CouchbaseCluster('http://127.0.0.1:8091');
$manager = $cluster->manager('MYUSER', 'MYPASSWORD');
$manager->createBucket('new_bucket');
这确实会引发一些错误:

[cb,WARN] (htconfig L:130 I:0) <couchbase:8091> (CTX=0x5601e6fd7e90,bc_http) Got 404 on config stream. Assuming terse URI not supported on cluster
[cb,EROR] (htconfig L:122 I:0) <couchbase:8091> (CTX=0x5601e6fd7e90,bc_http) Got 404 on config stream. Assuming bucket does not exist as we've tried both URL types
[cb,EROR] (htconfig L:142 I:0) <couchbase:8091> (CTX=0x5601e6fd7e90,bc_http) Got non-success HTTP status code 404
[cb,WARN](htconfig L:130 I:0)(CTX=0x5601e6fd7e90,bc_http)在配置流中获得404。假设集群上不支持简洁的URI
[cb,EROR](htconfig L:122 I:0)(CTX=0x5601e6fd7e90,bc_http)在配置流上获得404。假设bucket不存在,因为我们已经尝试了这两种URL类型
[cb,EROR](htconfig L:142 I:0)(CTX=0x5601e6fd7e90,bc_http)未成功获取http状态代码404

但它确实有效。Couchbase论坛对于这些类型的问题来说是一个更好的地方——它们在那里反应非常快。

您尝试使用哪种版本的Couchbase和PHP?您尝试使用哪种版本的Couchbase和PHP?