PHP couchbase integration just shows version number only in phpinfo() -
i have tried integrate couchbase in php in centos 6.5 machine. , installed couchbase extension said in "http://www.couchbase.com/communities/php/getting-started". not able connect couchbase php. when checked phpinfo() shows version number of couchbase extension no configuration information showing there.
their example code no longer works , need update site. original code:
<?php // adjust these parameters match installation $cb = new couchbase("127.0.0.1:8091", "", "", "default"); $cb->set("a", 101); var_dump($cb->get("a")); ?>
to set-up new data bucket, go site's address: http://127.0.0.1:8091/index.html
or type following in command line:
curl -x post -d name=default -d ramquotamb=200 -d authtype=none -d replicanumber=2 -d proxyport=11215 http://127.0.0.1:8091/pools/default/buckets
then need call couchbasecluster
instead of couchbase
this:
<?php // adjust these parameters match installation $cb = new couchbasecluster("127.0.0.1:8091", "", ""); $db = $cb->openbucket("default"); $db->upsert("a", array("value" => 10)); $var_a = $db->get("a"); var_dump($var_a->value); ?>
your output should this:
object(stdclass)#4 (1) { ["value"]=> int(10) }
Comments
Post a Comment