$cluster = new CouchbaseCluster('couchbase://localhost:8093', 'root', '123456');
$bucket = $cluster->openBucket('travel-sample');
$query = CouchbaseN1qlQuery::fromString("SELECT * FROM `travel-sample`");
$results = $bucket->query($query);
And im getting this now:
Uncaught CouchbaseException: LCB_CONNECT_ERROR: Error while establishing
TCP connection. Enable detailed error codes (via
LCB_CNTL_DETAILED_ERRCODES, or via `detailed_errcodes` in the connection
string) and/or enable logging to get more information in
[CouchbaseNative]/CouchbaseBucket.class.php:76
Stack trace:
#0 [CouchbaseNative]/CouchbaseBucket.class.php(76):
_CouchbaseBucket->__construct('couchbase://loc...', 'travel-sample',
'')
#1 [CouchbaseNative]/CouchbaseCluster.class.php(70):
CouchbaseBucket->__construct('couchbase://loc...', 'travel-sample',
'', NULL)
@avsej Thanks. Its because the port 8091 was not open on my system. I dont know why. I openned that and I did > $cluster = new CouchbaseCluster(‘couchbase://localhost’, ‘root’, ‘123456’);
and worked!