After successfully installing and running Couchbase on my Linux box, I’ve decided to install Couchbase and the PHP SDK on my Mac because I’m more productive on it. When I use PECL on the Mac, it fails with the following, just as it did for others in another past thread:
mkdir fastlz/.libs
mkdir: fastlz: No such file or directory
make: *** [fastlz/fastlz.lo] Error 1
ERROR: `make’ failed
So, I got and get the tar for php5.6.22 and recompiled that and it’s complied now in the /usr/bin. I now have the source files for future use and an updated php setup.
I then downloaded and decompressed the git for Couchbase. I followed the usual instructions from the PHP website (PHP: Compiling shared PECL extensions with phpize - Manual). I figured that I’d end up with a .so file at the end and move that somewhere, then edit the appropriate php.ini file.
For starters, it wouldn’t let me run it as a normal user. I’m looking over the permissions and the files are owned by root and staff group members only have read access. Not sure if I should do a mass chown on them. I went ahead and ran phpize under sudo and seemed to work fine.
When make is run, I get the following error:
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/couchbase.so -bundle .libs/bucket.o .libs/cas.o .libs/cluster.o .libs/couchbase.o .libs/docfrag.o .libs/exception.o .libs/get.o .libs/unlock.o .libs/metadoc.o .libs/opcookie.o .libs/paramparser.o .libs/transcoding.o .libs/touch.o .libs/remove.o .libs/subdoc.o .libs/store.o .libs/n1ql.o .libs/http.o .libs/counter.o .libs/durability.o .libs/n1ix_spec.o .libs/n1ix_list.o .libs/n1ix_create.o .libs/n1ix_drop.o fastlz/.libs/fastlz.o -L/usr/local/lib -lcouchbase -Wl,-rpath -Wl,/usr/local/lib
duplicate symbol _oldformat_t in:
.libs/bucket.o
.libs/get.o
.
.
.
.
duplicate symbol _compression_t in:
.libs/bucket.o
.libs/n1ix_drop.o
ld: 52 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [couchbase.la] Error 1
My question, is it possible to plop the git contents inside the php source tree, and from the base of the php source, run a ./configure --enable-couchbase like you can with other extensions (or does the .so need to be compiled for this --enable command)? I’m just looking over the source tree and not sure where to match up what from the contents of the git right now…
Historically, I’ve relied on PECL for this kind of work.
Also, when I followed the instruction from the README.md file, when I ran the ./config, it told me that --enable-couchbase is an unrecognized command.
Thanks.