Details
-
Improvement
-
Resolution: Fixed
-
Test Blocker
-
None
-
*Location*: http://developer.couchbase.com/documentation/server/4.0/sdks/php-2.0/hello-couchbase.html
*User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36
*Referrer*: http://developer.couchbase.com/documentation/server/4.0/sdks/php-2.0/getting-started.html
*Screen Resolution*: 2560 x 1440
*Location*: http://developer.couchbase.com/documentation/server/4.0/sdks/php-2.0/hello-couchbase.html *User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36 *Referrer*: http://developer.couchbase.com/documentation/server/4.0/sdks/php-2.0/getting-started.html *Screen Resolution*: 2560 x 1440
Description
Please route to the php SDK dev team.
If you follow the instruactions, and take the sample Hello World code for the php SDK from:
http://developer.couchbase.com/documentation/server/4.0/sdks/php-2.0/hello-couchbase.html
Running this leads to an error:
tom@haswell:~/cb/code/php$ php hello-couchbase.php
PHP Notice: Trying to get property of non-object in /home/tom/cb/code/php/hello-couchbase.php on line 14
PHP Notice: Trying to get property of non-object in /home/tom/cb/code/php/hello-couchbase.php on line 14
, ABV:
It appears this can be resolved by replacing the line:
$doc = $result->value;
With the line:
$doc = json_decode($result->value);
Not sure if the format type detection is supposed to be automatically detected by JSON, but it doesn't appear to work out the box.
Version info:
PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
From phpinfo():
couchbase
Version => 2.1.0
libcouchbase info:
./x86_64-linux-gnu/libcouchbase.so.2
./x86_64-linux-gnu/pkgconfig/libcouchbase.pc
./x86_64-linux-gnu/libcouchbase.so.2.0.33
./x86_64-linux-gnu/libcouchbase.so
./x86_64-linux-gnu/libcouchbase_libevent.so
./php5/20121212/couchbase.so
Reporter: Tom
E-mail: tom@chaoscube.xyz