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:

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

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 
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 + "").
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

1 comment:

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