Couchbase PHP Client Library

Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History


Connecting to a Live Server

The 1.0.x PHP Couchbase Client Library does not currently use multiple URIs, but this can be easily worked around when setting up the connection. A future release will add support for multiple URIs.

$servers = array("http://server1:8091", "http://server2:8091");

function my_couchbase_connect($servers) {
  do {
    if(empty($servers)) {
      echo "no suitable server found";
      return false;
      // throw
    $server = array_pop($servers);
    $cb = couchbase_connect($server);
  } while(!$cb);

  return $cb;
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.