PHP Fatal error: Class 'Couchbase' not found

I am trying to setup php to connect to couchbase and I get the following

PHP Fatal error: Class ‘Couchbase’ not found in /var/www/html/test-cbs-connection.php on line 3

Here is php source:

cat /var/www/html/test-cbs-connection.php

<?php // adjust these parameters to match your installation $cb = new Couchbase("", "", "", "default"); $cb->set("a", 101); var_dump($cb->get("a")); ?>

This is my server side configuration:

rpm -qa | grep libcouchbase


cat /etc/php.d/couchbase.ini

; Enable couchbase extension module
extension =
extension =

php -m|grep couchbase


php /var/www/html/phpinfo.php |grep couchbase

Additional .ini files parsed => /etc/php.d/couchbase.ini,

Thanks in advance for your assistance.

Which Webserver are you using?
Does the webserver user have read access to /etc/php.d/couchbase.ini?
I would replace php source with:

<?php phpinfo(); ?>

This will help you debug the problem as it will print out the modules and ini files that are being read.

I am using httpd-2.2.15-30.el6.centos.x86_64

ls -l /etc/php.d/couchbase.ini

-rw-r–r-- 1 root root 81 Jul 15 01:01 /etc/php.d/couchbase.ini

php /var/www/html/phpinfo.php | grep couch

Additional .ini files parsed => /etc/php.d/couchbase.ini,

cat /etc/php.d/couchbase.ini

; Enable couchbase extension module
extension =
extension =

Hey Ryan,

Looks like you may be using the 2.x edition of our SDK which has changed the interfaces significantly. Take a look at our new documentation site ( for more information!

Cheers, Brett

I’ve installed couchbase on centos 7 server:

Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/’
install ok: channel://
configuration option “php_ini” is not set to php.ini location
You should add “” to php.ini

Although I’ve uploaded file to test this on domain over this server:

It throwing the same error class not found.

I guess there’s any compatibility issue or may I need to upload “cb.php” (test file) at parent location as IP but this I can’t. Is this may cause the issue as I am trying to access couchbase class from domain location.

Or its not an issue at all I should access couchbase class from any place.