Couchbase Server 3.0 & PHP SDK 2.0 on CentOS 6.5


#1

It appears to be impossible to install PHP SDK 2.0 on a server with Couchbase Server 3.0 installed. Despite numerous reinstalls of all libcouchbase, libcouchbase2-devel, couchbase server 3.0, nothing seems to work. Every time I try to run pecl install couchbase, I get incompatible -lcouchbase or the couchbase extenstion requires libcouchbase.

And of course the couchbase website doesn’t have any documentation on this. Beyond frustrated. Have been banging my head against a brick wall for the last four days on this.

Any help would be greatly appreciated.

EDIT: Install log:

pecl install couchbase
12 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
building in /var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1
running: /var/tmp/couchbase/configure
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for a sed that does not truncate output… /bin/sed
checking for cc… cc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether cc accepts -g… yes
checking for cc option to accept ISO C89… none needed
checking how to run the C preprocessor… cc -E
checking for icc… no
checking for suncc… no
checking whether cc understands -c and -o together… yes
checking for system library directory… lib
checking if compiler supports -R… no
checking if compiler supports -Wl,-rpath,… yes
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
checking target system type… x86_64-unknown-linux-gnu
checking for PHP prefix… /usr
checking for PHP includes… -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory… /usr/lib64/php/modules
checking for PHP installed headers prefix… /usr/include/php
checking if debug is enabled… no
checking if zts is enabled… no
checking for re2c… re2c
checking for re2c version… 0.13.5 (ok)
checking for gawk… gawk
checking whether to enable Couchbase support… yes, shared
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking libcouchbase/couchbase.h usability… yes
checking libcouchbase/couchbase.h presence… yes
checking for libcouchbase/couchbase.h… yes
checking config.h usability… no
checking config.h presence… no
checking for config.h… no
checking couchbase.h usability… no
checking couchbase.h presence… no
checking for couchbase.h… no
checking datainfo.h usability… no
checking datainfo.h presence… no
checking for datainfo.h… no
checking exception.h usability… no
checking exception.h presence… no
checking for exception.h… no
checking phpstubstr.h usability… no
checking phpstubstr.h presence… no
checking for phpstubstr.h… no
checking for a sed that does not truncate output… (cached) /bin/sed
checking for fgrep… /bin/grep -F
checking for ld used by cc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface… BSD nm
checking whether ln -s works… yes
checking the maximum length of command line arguments… 1966080
checking whether the shell understands some XSI constructs… yes
checking whether the shell understands “+=”… yes
checking for /usr/bin/ld option to reload object files… -r
checking for objdump… objdump
checking how to recognize dependent libraries… pass_all
checking for ar… ar
checking for strip… strip
checking for ranlib… ranlib
checking command to parse /usr/bin/nm -B output from cc object… ok
checking for dlfcn.h… yes
checking for objdir… .libs
checking if cc supports -fno-rtti -fno-exceptions… no
checking for cc option to produce PIC… -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works… yes
checking if cc static flag -static works… no
checking if cc supports -c -o file.o… yes
checking if cc supports -c -o file.o… (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/sh /var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/libtool --mode=compile cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/couchbase.c -o couchbase.lo
libtool: compile: cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/couchbase.c -fPIC -DPIC -o .libs/couchbase.o
/bin/sh /var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/libtool --mode=compile cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/cluster.c -o cluster.lo
libtool: compile: cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/cluster.c -fPIC -DPIC -o .libs/cluster.o
/var/tmp/couchbase/cluster.c: In function ‘zim_Cluster___construct’:
/var/tmp/couchbase/cluster.c:176: warning: ‘lcb_set_error_callback’ is deprecated (declared at /usr/include/libcouchbase/deprecated.h:88)
/bin/sh /var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/libtool --mode=compile cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/bucket.c -o bucket.lo
libtool: compile: cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/bucket.c -fPIC -DPIC -o .libs/bucket.o
/var/tmp/couchbase/bucket.c: In function ‘zim_Bucket___construct’:
/var/tmp/couchbase/bucket.c:500: warning: ‘lcb_set_error_callback’ is deprecated (declared at /usr/include/libcouchbase/deprecated.h:88)
/bin/sh /var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/libtool --mode=compile cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/exception.c -o exception.lo
libtool: compile: cc -I. -I/var/tmp/couchbase -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/couchbase/exception.c -fPIC -DPIC -o .libs/exception.o
/bin/sh /var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/libtool --mode=link cc -DPHP_ATOM_INC -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/include -I/var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/main -I/var/tmp/couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o couchbase.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/pear-build-ss16652pHcguU/couchbase-2.0.1/modules couchbase.lo cluster.lo bucket.lo exception.lo -lcouchbase
libtool: link: cc -shared .libs/couchbase.o .libs/cluster.o .libs/bucket.o .libs/exception.o -lcouchbase -Wl,-soname -Wl,couchbase.so -o .libs/couchbase.so
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/libcouchbase.so when searching for -lcouchbase
/usr/bin/ld: skipping incompatible /usr/lib/libcouchbase.so when searching for -lcouchbase
/usr/bin/ld: cannot find -lcouchbase
collect2: ld returned 1 exit status
make: *** [couchbase.la] Error 1
ERROR: `make’ failed


#2

It would seem you’ve chosen to use mismatched architectures using libcouchbase and php. Can you please paste the repository information (/etc/yum/repos.d/couchbase.repo) and the output of:

file /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../libcouchbase.so
file $(which php)

You will need the file utility for this, which is installable via the file package (yum install file).

Note that CentOS allows multiple architecture installations, so it is possible to install a 32 bit library on a 64 bit system.


#3

Thanks, that helped.


#4

Great news. Is this solved for you now?