PHP SDk 2.03 Uncaught exception

I am trying to do a basic connect.
I am positive the cb server is set correctly since it work great using sdk 1.2.2.

$cb = new CouchbaseCluster(‘127.0.0.1’,’’,’’);
$myBucket = $cb->openBucket(“default”,’’);

I also tried CouchbaseCluster(‘couchbase://127.0.0.1’)
and CouchbaseCluster(‘http://127.0.0.1’)
with all sorts of combos using 8091 etc…

PHP 5.3.10-1ubuntu3.15
Couchbase PHP SDK 2.03

Returns

PHP Fatal error: Uncaught exception ‘CouchbaseException’ with message ‘Invalid input/arguments’ in [CouchbaseNative]/CouchbaseBucket.class.php:74
Stack trace:
#0 [CouchbaseNative]/CouchbaseBucket.class.php(74): _CouchbaseBucket->__construct(‘127.0.0.1/defau…’, ‘default’, ‘’)
#1 [CouchbaseNative]/CouchbaseCluster.class.php(61): CouchbaseBucket->__construct(‘127.0.0.1/defau…’, ‘default’, ‘’)
#2 /usr/share/nginx/_admin/n1ql.php(6): CouchbaseCluster->openBucket(‘default’)
#3 {main}
thrown in [CouchbaseNative]/CouchbaseBucket.class.php on line 74

Thank for any advise.

KH

I fixed my own issue and wanted to share in case someone else has this issue.

I had a previous version of the couchbase c sdk library installed on my ubuntu server.
ldd couchbase.so showed
/usr/local/lib/libcouchbase.so.2 -> libcouchbase.so.2.0.14

when in fact it should have been pointing to
/usr/lib/x86_64-linux-gnu/libcouchbase.so.2 -> libcouchbase.so.2.0.22

I still need to use the 1.2.2 sdk for php-fpm to use while I test the new SDK at the command line. I simple export the library path while I’m testing

export LD_LIBRARY_PATH=/lib:/usr/lib/x86_64-linux-gnu

Things work as expected :smile: