Thursday, December 5, 2013

Couchbase php ext installation on centos

I tried to install couchbase php sdk on centos system.As it looks like simple;but there are some known problems(http://www.couchbase.com/communities/q-and-a/centos5-cant-get-php-client-library-cant-install-php-sdk) so i got stucked.

In attempt of finding solution;I find following way of installation


  1. #wget http://packages.couchbase.com/clients/c/libcouchbase-2.2.0_centos62_i686.tar
  2. #tar -xvf libcouchbase-2.2.0_centos62_i686.tar
  3. #cd libcouchbase-2.2.0_centos62_i686
  4. #rpm -ivh libcouchbase2-bin-2.2.0-1.i686.rpm libcouchbase2-core-2.2.0-1.i686.rpm libcouchbase-devel-2.2.0-1.i686.rpm
  5. #pecl install couchbase
  6. #vim /etc/php.d/couchbase.ini
extension=couchbase.so

But adding couchbase.so raises following error
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/couchbase.so' - /usr/lib/php/modules/couchbase.so: undefined symbol: php_json_encode in Unknown on line 0

  • For fixing this
 #rm -f /etc/php.d/couchbase.ini
#vim /etc/php.d/json.ini

and at the end of this file(json.ini) add

extension=couchbase.so

Save it and it will start working

(Ref-http://www.couchbase.com/forums/thread/couchbaseso-undefined-symbol-phpjsonencode-unknown-line-0)

No comments: