Saturday, January 19, 2013

Installing Couchbase PHP SDK for PHP 5.4 + Couchbase Server 2.0

  1. Couchbase Server doesn't have repositories (at this moment). That's not cool, of course. Forget about apt-get update.
  2. Precompiled SDK package for PHP is not compatible with PHP 5.4 API. So don't waste your time and compile it from sources. And, of course, forget about apt-get update. Very "enterprise" way, what can I say...
  3. Couchbase Server GUI looks very attractive. Has email alerts and lot of graphics for monitoring.
  4. No hot-fixes for Community version.
If in this article you are looking instructions "how to install", then just open pages with instructions:

Server:
Couchbase Server Manual - Installation
Don't forget to configure server in web-interface.

Client:
Install PHP SDK for Couchbase
At the moment of writing this article, precompiled PHP SDK package is not compatible with PHP 5.4, so use sources (link "Source archive."). 
Before compilation, install packages php5-dev and php-pear. 
Then download, unzip, go to unzipped folder and run 
phpize
./configure
make
sudo make install
and copy path of generated module from output. You need to add it into php.ini
For php5-fpm it will be:
sudo nano /etc/php5/fpm/conf.d/couchbase.ini
and add line (use generated path + "couchbase.so").
extension=/usr/lib/php5/20100525+lfs/couchbase.so
Now restart php
sudo /etc/init.d/php5-fpm restart 
And check it:
php -m | grep couchbase 
In output you should see "couchbase". Also, in phpinfo() you will see something like
Now you can write your genius code :)
For auto-completion in IDE you can use https://github.com/couchbase/php-ext-couchbase/blob/master/example/couchbase-api.php

4 comments:

  1. Excellent - quick fix to my newly upgraded 13.04. Thanks.

    ReplyDelete
  2. php web development,web design and development,web and mobile application development,cms development,web site maintenance

    http://www.xudutech.com

    ReplyDelete
  3. how to secure wep config in php please share also this article

    ReplyDelete
  4. ; Grow your business with a custom-built, interactive mobile site builder. Avoid the stress and hassle of building the mobile website yourself, So, choose it for the platform’s simplicity with affordable pricing . Thank you.....
    web development

    ReplyDelete