I am running Community Edition 6.0.0, PHP 7.3 and PHP SDK 2.6.0.
Freshly installed Couchbase on Ubuntu 16.04
sdk-doctor gives OK from my PHP-server:
17:51:28.038 INFO ▶ Parsing connection string `couchbase://10.0.0.109/limelayer`
17:51:28.065 INFO ▶ Connection string identifies the following CCCP endpoints:
17:51:28.065 INFO ▶ 1. 10.0.0.109:11210
17:51:28.065 INFO ▶ Connection string identifies the following HTTP endpoints:
17:51:28.065 INFO ▶ 1. 10.0.0.109:8091
17:51:28.065 INFO ▶ Connection string specifies bucket `limelayer`
17:51:28.065 WARN ▶ Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance
17:51:28.065 INFO ▶ Performing DNS lookup for host `10.0.0.109`
17:51:28.065 INFO ▶ Attempting to connect to cluster via CCCP
17:51:28.065 INFO ▶ Attempting to fetch config via cccp from `10.0.0.109:11210`
17:51:28.066 INFO ▶ Selected the following network type: default
17:51:28.066 INFO ▶ Identified the following nodes:
17:51:28.066 INFO ▶ [0] 10.0.0.109
17:51:28.066 INFO ▶ indexAdmin: 9100, indexHttp: 9102, indexStreamCatchup: 9104
17:51:28.066 INFO ▶ projector: 9999, kv: 11210, moxi: 11211
17:51:28.066 INFO ▶ mgmt: 8091, fts: 8094, n1ql: 8093
17:51:28.066 INFO ▶ indexStreamMaint: 9105, capi: 8092, indexScan: 9101
17:51:28.066 INFO ▶ indexStreamInit: 9103
17:51:28.066 INFO ▶ Fetching config from `10.0.0.109:8091`
17:51:28.067 INFO ▶ Failed to retreive cluster information (status code: 401)
17:51:28.067 INFO ▶ Successfully connected to KV service at `10.0.0.109:11210`
17:51:28.068 INFO ▶ Successfully connected to MGMT service at `10.0.0.109:8091`
17:51:28.069 INFO ▶ Successfully connected to CAPI service at `10.0.0.109:8092`
17:51:28.069 INFO ▶ Successfully connected to N1QL service at `10.0.0.109:8093`
17:51:28.070 INFO ▶ Successfully connected to FTS service at `10.0.0.109:8094`
17:51:28.071 INFO ▶ Memd Nop Pinged `10.0.0.109:11210` 10 times, 0 errors, 0ms min, 0ms max, 0ms mean
17:51:28.071 INFO ▶ Diagnostics completed
However, when running the example from the documentation:
$bucketName = "limelayer";
// Establish username and password for bucket-access
$authenticator = new \Couchbase\PasswordAuthenticator();
$authenticator->username('limelayer')->password('xxxxxxx');
// Connect to Couchbase Server
$cluster = new CouchbaseCluster("couchbase://10.0.0.109");
// Authenticate, then open bucket
$cluster->authenticate($authenticator);
$bucket = $cluster->openBucket($bucketName);
// Store a document
echo "Storing u:king_arthur\n";
$result = $bucket->upsert('u:king_arthur', array(
"email" => "kingarthur@couchbase.com",
"interests" => array("African Swallows")
));
var_dump($result);
Gives timeout error:
Storing u:king_arthur
<br />
<b>Fatal error</b>: Uncaught Couchbase\Exception: LCB_ETIMEDOUT: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout in /opt/www/limelayer.com/api/commands/get.php:20
Stack trace:
#0 /opt/www/limelayer.com/api/commands/get.php(20): Couchbase\Bucket->upsert('u:king_arthur', Array)
#1 /opt/www/framework.limelayer.com/v2/classes/router.php(52): require('/opt/www/limela...')
#2 /opt/www/framework.limelayer.com/v2/framework.php(11): Router::execute()
#3 /opt/www/limelayer.com/api/index.php(13): require('/opt/www/framew...')
#4 {main}
thrown in <b>/opt/www/limelayer.com/api/commands/get.php</b> on line <b>20</b><br />
If I change the password, I get authentication error, so I see that it reaches the server. It’s only when I try to do a write I get the timeout error. Any ideas?