Sri Harsha Sri Harsha - 2 years ago 202
PHP Question

Need help to install C SDK and PHP SDK for couchbase server 4.0.0 for UBUNTU 14.0

I have recently started working on couchbase with laravel 5.2 on UBUNTU 14.04 OS. After I installed everything, I am able to see couchbase admin home page but could not able to access it from my code. Below are the steps I followed. Can someone please check and suggest if I miss anything.

1) Downloaded and installed couchbase server 4.0.0 successfully.

2) Downloaded C SDK as mentioned below

wget -O- | sudo apt-key add -
echo "deb trusty trusty/main" >> /etc/apt/sources.list.d/couchbase.list
apt-get update
sudo apt-get install libcouchbase2-core libcouchbase2-libevent libcouchbase-dev

Then installed PHP SDK using PECL

sudo pecl install couchbase

4) After everything got installed, I have opened my composer.json file in my laravel project and added below line

"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"ytake/laravel-couchbase": "^0.2.0"

Then ran composer update.

5) My config/databse.php settings

'couchbase' => [
'driver' => 'couchbase',
'host' => 'http://localhost',
'user' => 'admin',
'password' => 'admin123',
'bucket' => 'laravel',
'persist_conn' => true,
'display_limit' => 20,

6)Tried to access records from "laravel" bucket.



namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;

class HomeController extends Controller {

public function index() {


// $cb = new Couchbase("http://localhost:8091/", "admin", "admin123", "laravel");
// $cb->set("a", 101);
// var_dump($cb->get("a"));
// $cluster = new CouchbaseCluster('');
// $bucket = $cluster->openBucket('laravel');
// $bucket->insert('a', 101);
// var_dump($bucket->get('a'));


Issue:#1 There I am getting "FatalErrorException in CouchbaseConnector.php line 35:Class 'CouchbaseCluster' not found".

Issue:#2 I am not able to see "Couchbase" in phpinfo();

Answer Source

This issue got resolved after I add couchbase.ini file in below location. /etc/php5/cli/conf.d/


; Enable couchbase extension module
extension =
extension =

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download