Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Can't install PHP client library v.1.1

27 replies [Last post]
  • Login or register to post comments
Fri, 12/14/2012 - 09:28
creotiv
Offline
Joined: 11/14/2011
Groups: None

My OS is CentOS 5.6

First i installed C SDK library v2.0 from repo.
Then i installed PHP module couchbase.so
And on the php-fpm restart got this:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/couchbase.so' - /usr/lib64/php/modules/couchbase.so: undefined symbol: php_couchbase_touch__multi_impl in Unknown on line 0

Top
  • Login or register to post comments
Fri, 12/14/2012 - 10:17
ingenthr
Offline
Joined: 03/16/2010
Groups:

This is owing to an issue, PCBC-163. Attached to the issue in our issue tracker you'll find an experimental verification fix, and we're going to spin up a 1.1.1 release probably today with the fix.

Sorry for the hassle!

Top
  • Login or register to post comments
Fri, 12/14/2012 - 11:25
creotiv
Offline
Joined: 11/14/2011
Groups: None

Thanks for the fast answer)

Top
  • Login or register to post comments
Sat, 12/15/2012 - 12:14
ingenthr
Offline
Joined: 03/16/2010
Groups:

No problem. Version 1.1.1 of the PHP client library is now available at couchbase.com/develop/php/current

Top
  • Login or register to post comments
Sat, 12/15/2012 - 14:24
creotiv
Offline
Joined: 11/14/2011
Groups: None

Thanks again))

Top
  • Login or register to post comments
Sun, 12/16/2012 - 03:59
creotiv
Offline
Joined: 11/14/2011
Groups: None

Installed new version and got version compile problem:
PHP Warning: PHP Startup: couchbase: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0

When tried to compile from the source got the old error. Seems to me that the source version ob lib is still v1.1

Top
  • Login or register to post comments
Sun, 12/16/2012 - 04:15
creotiv
Offline
Joined: 11/14/2011
Groups: None

Installed from git repo.

But got strange error:
Couchbase::get() expects at most 2 parameters, 3 given

but the manual(http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-retrie...) says this:
$object->get($key [, $callback ] [, $casunique ])

Top
  • Login or register to post comments
Sun, 12/16/2012 - 10:03
ingenthr
Offline
Joined: 03/16/2010
Groups:

Yes, that's another issue that was found very recently and we'll likely do a 1.1.2 to fix.

Do you use the callback? Most people don't it seems. A workaround for now would be to remove the param for the callback.

Sorry for the trouble here. We didn't mean to make a big API change, but thought the callback was kind of odd and not being used. It's position in the arguments makes it more important than CAS though, which we see being used pretty regularly.

Top
  • Login or register to post comments
Sun, 12/16/2012 - 10:20
ingenthr
Offline
Joined: 03/16/2010
Groups:

Note that issue PCBC-166 tracks what we'll be doing here.

Top
  • Login or register to post comments
Mon, 12/17/2012 - 02:03
creotiv
Offline
Joined: 11/14/2011
Groups: None

No, i'm not using callback. But found this bug and just wanted to let you know.

Top
  • Login or register to post comments
Mon, 12/17/2012 - 03:21
creotiv
Offline
Joined: 11/14/2011
Groups: None

Found one more bug.
Installed client lib to production server(it have some difference with dev) and got this:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/couchbase.so' - /usr/lib64/php/modules/couchbase.so: undefined symbol: php_json_encode in Unknown on line 0

I already had this error, and it was fixed with loading lib after json lib. But now it not helped. It still throwing error even if couchbase.so loading after json.so

Top
  • Login or register to post comments
Mon, 12/17/2012 - 12:26
TimSmith
Offline
Joined: 02/09/2011
Groups:

This one does look like the json module isn't loading on your production box. Can you ensure that it is loading properly? Can you provide phpinfo() for the problem box?

Thanks,

Tim

Top
  • Login or register to post comments
Mon, 12/17/2012 - 12:28
creotiv
Offline
Joined: 11/14/2011
Groups: None

Problem is that json is loaded because i used it at app.

Here is info
$php -i | grep json
Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x 86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' ' --prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '- -sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/ usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir= /usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=.. /config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-conf ig-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '- -without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr ' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t 1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with -jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with- layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-soc kets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-mime-m agic' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system- tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--w ith-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-ncurses=shar ed' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db 4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-m ysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--enable-dom=sha red' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--e nable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enabl e-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=s hared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '-- with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-dblib=sh ared,/usr' '--enable-json=shared' '--enable-zip=shared' '--with-readline' '--ena ble-dbase=shared' '--with-pspell=shared' '--with-mcrypt=shared,/usr' '--with-mha sh=shared,/usr' '--with-tidy=shared,/usr' '--with-mssql=shared,/usr' '--enable-s ysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-pos ix=shared' '--with-unixODBC=shared,/usr' '--with-recode=shared,/usr' '--with-lib event=shared' '--with-fpm' '--with-fpm-bin=/usr/bin/php-cgi' '--with-fpm-port=90 00' '--with-fpm-conf=/etc/php-fpm.conf' '--with-fpm-log=/var/log/php-fpm.log' '- -with-fpm-pid=/var/run/php-fpm.pid' '--with-fpm-user=nobody' '--with-fpm-group=n obody' '--with-interbase=shared,/usr/lib64/firebird' '--with-pdo-firebird=shared ,/usr/lib64/firebird}'
/etc/php.d/json.ini,
json
json support => enabled
json version => 1.2.1
json support => no

Top
  • Login or register to post comments
Mon, 12/17/2012 - 18:52
ingenthr
Offline
Joined: 03/16/2010
Groups:

Per your update on the issue tracker, I think part of the problem is that you may be using PHP 5.2, instead of 5.3. Can you confirm?

Top
  • Login or register to post comments
Tue, 12/18/2012 - 01:12
creotiv
Offline
Joined: 11/14/2011
Groups: None

Yes i'm using PHP 5.2.17. But the dev server on wich i normally installed lib have PHP 5.2.17 too. And also i cant switch to php 5.3.

Top
  • Login or register to post comments
Tue, 12/18/2012 - 05:50
creotiv
Offline
Joined: 11/14/2011
Groups: None

Can you recommend some hotfix for this problem, because i need switch to couchbase lib ASAP, or i must wait for new release?

Top
  • Login or register to post comments
Tue, 12/18/2012 - 09:52
TimSmith
Offline
Joined: 02/09/2011
Groups:

I've not seen any problems with stock Centos 5.8 and installing all needed tools (PHP, nginx, etc.) from yum using the Couchbase centos55 repo and the EPEL + remi repos.

[root@localhost ~]# yum list installed | egrep 'php|couch|vbuck'
couchbase-server.x86_64 1.8.1-937 installed
libcouchbase-devel.x86_64 2.0.1-1 installed
libcouchbase2-core.x86_64 2.0.1-1 installed
libvbucket1.x86_64 1.8.0.4-1 installed
php.x86_64 5.3.15-1.el5.remi installed
php-cli.x86_64 5.3.15-1.el5.remi installed
php-common.x86_64 5.3.15-1.el5.remi installed
php-devel.x86_64 5.3.15-1.el5.remi installed
php-fpm.x86_64 5.3.15-1.el5.remi installed
php-pear.noarch 1:1.9.4-11.el5.remi.1 installed
php-pecl-igbinary.x86_64 1.1.1-2.el5.remi installed
php-pecl-memcached.x86_64 2.1.0-4.el5.remi installed
[root@localhost ~]# ls /etc/yum.repos.d/
aegisco.repo CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo couchbase.repo epel.repo epel-testing.repo rbel5.repo remi.repo
[root@localhost ~]# cat /etc/yum.repos.d/remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

[remi-test]
name=Les RPM de remi en test pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/test/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[root@localhost ~]# cat /etc/yum.repos.d/couchbase.repo
[couchbase]
name = Couchbase package repository
baseurl = http://packages.couchbase.com/rpm/5.5/x86_64
gpgcheck = 1
gpgkey = http://packages.couchbase.com/rpm/couchbase-rpm.key
[root@localhost ~]#

I would recommend trying a clean slate as much as possible, and use the above well-known repos for packages. It should work fine together.

Tim

Top
  • Login or register to post comments
Tue, 12/18/2012 - 09:55
creotiv
Offline
Joined: 11/14/2011
Groups: None

You are using php.x86_64 5.3.15-1.el5.remi
and we are usign php 5.2.17, and we can't switch to 5.3.

Top
  • Login or register to post comments
Tue, 12/18/2012 - 12:41
TimSmith
Offline
Joined: 02/09/2011
Groups:

OK, I want to make sure I don't lose track of what's going on with the various threads. It sounds like what is important at the moment is for you to get past this error:

> But got strange error:
> Couchbase::get() expects at most 2 parameters, 3 given
> but the manual(http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-retrie...) says this:
> $object->get($key [, $callback ] [, $casunique ])

The quick workaround for that is to change your get call from ->get($key, null, $casId) to ->get($key, $casId). Just remove the null argument.

This may be changing in the 1.1.2 release, but this workaround can be implemented immediately and should avoid the error.

The issue of php_json_encode as an undefined symbol is some config issue w/ PHP, maybe couchbase extension is specified in php.ini multiple times, and one time is too early. Or something like that.

Tim

Top
  • Login or register to post comments
Tue, 12/18/2012 - 13:06
creotiv
Offline
Joined: 11/14/2011
Groups: None

param error is not a problem, i mentioned it here only that you can add it to fix list for the next version.

The problem is with php_json_encode. And it defined only once.

If it specified multiple times it will not make any difference for couchbase lib, because needed methods already defined. I think problem can be with some characters encoding, similar problem was in version 1.0b as i now.

Also when i run test on compile with:
make test

i got all test failed. And in every test error the same. I can send you report if you want

Top
  • Login or register to post comments
Tue, 12/18/2012 - 14:27
TimSmith
Offline
Joined: 02/09/2011
Groups:

I don't know how to help you with the "undefined symbol" error. I still think this must be a config problem. If you specify extension=couchbase.so in the php.ini file, but json.so in /etc/php.d/json.ini, you may find that couchbase.so is being loaded first and failing. You'd need to remove it from php.ini and configure it via php.d/zzz-couchbase.ini (zzz prefix to ensure it is seen after json.ini). That's what works for me, anyways.

I removed all my other PHP packages and the remi repo. I looked around for PHP 5.2 for Centos 5, and installed the utterramblings repo as:

$ cat /etc/yum.repos.d/utterramblings.repo
# http://www.jasonlitka.com/yum-repository/

[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
includepkgs=php*

I installed PHP 5.2.17 from there, built php-ext-couchbase from current git master branch, and copied couchbase.so to /usr/lib64/php/modules/couchbase.so, and it works.

[root@localhost html]# yum list installed | egrep 'couch|php'
couchbase-server.x86_64 1.8.1-937 installed
libcouchbase-devel.x86_64 2.0.1-1 installed
libcouchbase2.x86_64 2.0.1-1 installed
libcouchbase2-core.x86_64 2.0.1-1 installed
libcouchbase2-libevent.x86_64 2.0.1-1 installed
php.x86_64 5.2.17-jason.2 installed
php-cli.x86_64 5.2.17-jason.2 installed
php-common.x86_64 5.2.17-jason.2 installed
php-devel.x86_64 5.2.17-jason.2 installed
php-pear.noarch 1:1.4.9-8.el5 installed

Ensure you have libcouchbase2-libevent installed.

Finally, I found one issue that I can't solve, that I believe is happening only with PHP 5.2 and not 5.3. I filed a bug report for it:

"PHP 5.2 w/ 1.1.1 client doesn't connect to "default" bucket, named bucket works OK".
http://www.couchbase.com/issues/browse/PCBC-169

Regards,

Tim

Top
  • Login or register to post comments
Tue, 12/18/2012 - 14:35
TimSmith
Offline
Joined: 02/09/2011
Groups:

FYI, I've also found out that PHP 5.2 and earlier are not supported, and there are some known problems with the 5.2 JSON support that will not be fixed. So 5.2 use is at your own risk, and likely to have some issues with the Couchbase lib. I'm sorry to have that answer, but the effort is on supporting more current PHP versions.

Regards,

Tim

Top
  • Login or register to post comments
Tue, 12/18/2012 - 15:25
creotiv
Offline
Joined: 11/14/2011
Groups: None

i'm added couchbase.so in json.ini right after json.so. So it jsut can't load first.

Here is installed lit

$yum list installed | egrep 'couch|php '
libcouchbase-devel.x86_64 2.0.1-1 installed
libcouchbase2.x86_64 2.0.1-1 installed
libcouchbase2-core.x86_64 2.0.1-1 installed
libcouchbase2-libev.x86_64 2.0.1-1 installed
libcouchbase2-libevent.x86_64 2.0.1-1 installed
php.x86_64 5.2.17-4.el5 installed
php-cli.x86_64 5.2.17-4.el5 installed
php-common.x86_64 5.2.17-4.el5 installed
php-devel.x86_64 5.2.17-4.el5 installed
php-eaccelerator.x86_64 2:0.9.6.1-1.el5 installed
php-fpm.x86_64 5.2.17-4.el5 installed
php-mcrypt.x86_64 5.2.17-4.el5 installed
php-mysql.x86_64 5.2.17-4.el5 installed
php-odbc.x86_64 5.2.17-4.el5 installed
php-pdo.x86_64 5.2.17-4.el5 installed
php-pear.noarch 1:1.9.1-1.el5 installed
php-pecl-memcache.x86_64 3.0.6-1.el5 installed

The dev server have the same list, except it has couchbase-server.x86_64 installed(maybe it uses some of it libs)

Top
  • Login or register to post comments
Wed, 12/19/2012 - 07:19
creotiv
Offline
Joined: 11/14/2011
Groups: None

I found where was problem. It was in json.so library. I don't know how this can be, because version of libs is similar. But when i copy this lib from dev server to production server(where couchbase lib not working), error gone, and couchbase lib now load normally.

Top
  • Login or register to post comments
Wed, 12/19/2012 - 16:20
ingenthr
Offline
Joined: 03/16/2010
Groups:

Great news, note that the PHP 1.1.2 was released today with the fix for the get() function signature having changed.

Top
  • Login or register to post comments
Thu, 12/20/2012 - 02:16
creotiv
Offline
Joined: 11/14/2011
Groups: None

While was compiling v.1.1.2 got this error on make:

Warning: size of symbol `arginfo_construct' changed from 240 in .libs/apidecl.o to 160 in management/.libs/management.o
collect2: ld returned 1 exit status

Top
  • Login or register to post comments
Thu, 12/20/2012 - 02:52
creotiv
Offline
Joined: 11/14/2011
Groups: None

Also i found third identical server on wich both json libs not working with couchbase. I think they making some changes into the lib without changing lib version.

Also i downloaded latest version of JSON lib and found that it not pass Unicode test:

PASS JSON Test Pattern fail1 -> fail24
http://www.crockford.com/JSON/JSON_checker/test/fail*.json [tests/fail001.phpt]
FAIL JSON Test Pattern pass1.1]
Modified to test unescaped UNICODE as keys and values.
Modified to test numbers with exponents without a decimal point.
Modified to test empty string values.
Modified to test a mix of integers and strings as keys.
http://www.crockford.com/JSON/JSON_checker/test/pass1.json [tests/pass001.1.phpt]
PASS JSON Test Pattern pass1]
http://www.crockford.com/JSON/JSON_checker/test/pass1.json [tests/pass001.phpt]
PASS JSON Test Pattern pass2]
http://www.crockford.com/JSON/JSON_checker/test/pass2.json [tests/pass002.phpt]
PASS JSON Test Pattern pass3]
http://www.crockford.com/JSON/JSON_checker/test/pass3.json [tests/pass003.phpt]

So problems here i think.

Top
  • Login or register to post comments
Thu, 12/20/2012 - 06:28
creotiv
Offline
Joined: 11/14/2011
Groups: None

Fixed problem with installing php-5.2.17-24 from centalt repo with couchbase client v.1.1.1

[CentALT]
name=CentALT Packages for Enterprise Linux 5 - $basearch
baseurl=http://centos.alt.ru/repository/centos/5/$basearch/
enabled=1
gpgcheck=0

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker