Can't seem to get php sdk installed on ubuntu 15


#1

I’ve tried a few different things to get the PHP SDK installed on my box. This is literally day two for me with Couchbase, so I apologize in advance for any noob mistakes / questions.
I’ve attempted to install PHP SDK 2.0/2.1 but whenever I try my test web page, I get the following error:

Fatal error: Class ‘CouchbaseCluster’ not found in /var/www/html/phonesys/test.php on line 10

Line 10 looks like this:
$cluster = new CouchbaseCluster();

Here’s what I’ve done:

  1. Make sure to remove the older sdk i attempted:
    me@mydev:/var/www/html/phonesys$ sudo pecl uninstall couchbase-1.2.2
    Unable to remove “extension=couchbase.so” from php.ini
    uninstall ok: channel://pecl.php.net/couchbase-1.2.2

  2. Install the latest sdk:
    me@mydev:/var/www/html/phonesys$ sudo pecl install couchbase


    Build process completed successfully
    Installing '/usr/lib/php5/20131226/couchbase.so’
    install ok: channel://pecl.php.net/couchbase-2.1.0
    configuration option “php_ini” is not set to php.ini location
    You should add “extension=couchbase.so” to php.ini

I then ensured that i have the couchbase.so extension defined in my /etc/php5/apache2/php.ini file.
Then I restart apache.

What am I missing?
Any help would be appreciated.


#2

I just updated /etc/php5/cli/php.ini as well with extension=couchbase.so
and restarted apache… and now it’s happy.
not sure why i have to update the cli version when I’m browsing to my test page…
but it’s happier.


#3

Hello Wooj.

  1. $bucket = new CouchbaseCluster(“http://192.168.0.182:8091”, “Administrator”, “Passw”, “default”);
  2. $bucket->openBucket(“test”);

#4

yeah thanks Kozlov. I actually got it working. but thanks very much for taking the time to respond. much appreciated.