Cannot install SDK v2.1.0 on Mac OSX

When I try to install the PHP SDK in version 2.1.0 on my Mac OS X, as shown in the docs (C SDK via Homebrew, PHP SDK via pecl) I get the following error during the pecl call:

/bin/sh /private/var/folders/ky/vp_prm4178x_yhbb7nydy5dh0000gn/T/pear/temp/pear-build-simoncwYclG/couchbase-2.1.0/libtool --mode=compile cc  -I. -I/private/var/folders/ky/vp_prm4178x_yhbb7nydy5dh0000gn/T/pear/temp/couchbase -DPHP_ATOM_INC -I/private/var/folders/ky/vp_prm4178x_yhbb7nydy5dh0000gn/T/pear/temp/pear-build-simoncwYclG/couchbase-2.1.0/include -I/private/var/folders/ky/vp_prm4178x_yhbb7nydy5dh0000gn/T/pear/temp/pear-build-simoncwYclG/couchbase-2.1.0/main -I/private/var/folders/ky/vp_prm4178x_yhbb7nydy5dh0000gn/T/pear/temp/couchbase -I/usr/local/Cellar/php55/5.5.30/include/php -I/usr/local/Cellar/php55/5.5.30/include/php/main -I/usr/local/Cellar/php55/5.5.30/include/php/TSRM -I/usr/local/Cellar/php55/5.5.30/include/php/Zend -I/usr/local/Cellar/php55/5.5.30/include/php/ext -I/usr/local/Cellar/php55/5.5.30/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /private/var/folders/ky/vp_prm4178x_yhbb7nydy5dh0000gn/T/pear/temp/couchbase/fastlz/fastlz.c -o fastlz/fastlz.lo
/private/var/folders/ky/vp_prm4178x_yhbb7nydy5dh0000gn/T/pear/temp/pear-build-simoncwYclG/couchbase-2.1.0/libtool: line 1280: fastlz/fastlz.loT: No such file or directory
mkdir fastlz/.libs
mkdir: fastlz: No such file or directory
make: *** [fastlz/fastlz.lo] Error 1
ERROR: `make' failed

Any help is welcome!

I am currently working with the SDK in version 2.0.7 …

Hey @SimonSimCity,

It appears that there may be an issue with the fastlz files. Could you try to install the extension from github rather than pecl.

Cheers, Brett

I now tried to build from source (https://github.com/couchbase/php-couchbase/, tag v2.1.0) and it worked perfectly. What’s so wrong with the PECL package?

Hey @SimonSimCity,

I believe there may be a file missing from the pecl package some how.

Cheers, Brett

Hi, @brett19

I now tried out how the plugin works in production and I am constantly getting the following error when executing a view-query:

Fatal error: Cannot use object of type stdClass as array in [CouchbaseNative]/CouchbaseBucket.class.php on line 284

Here’s the PHP code I use:

$cc = new \CouchbaseCluster();
$cb = $cc->openBucket("mybucket");
$test = $cb->query(\CouchbaseViewQuery::from("foo", "bar"));

Maybe the code in the repository is differnt as well …? https://github.com/couchbase/php-couchbase/tree/v2.1.0

Hey @imonSimCity,

There is a bug in the most recent PHP release, please try the following:

$cc = new \CouchbaseCluster();
$cb = $cc->openBucket("mybucket");
$test = $cb->query(\CouchbaseViewQuery::from("foo", "bar"), null, true);

Cheers, Brett

Hi, @brett19

That works. Can you please make it work without the extra parameters?

I would gladly contribute with functional-tests that could be run against a working installation. Is it the PHP part or the underlying C library that you need to change here? If it’s just the PHP code, you could even do some tests, that could be run by calling make test when you are compiling the extension yourself.

Thank you @brett19, this also worked for me.
@SimonSimCity, thanks for the reference… :slight_smile:

@SimonSimCity, your original build issue has been fixed in http://review.couchbase.org/62647

@brett19 is this fixed in a particular release and/or is there an issue to follow? Or, do all usages of a CouchbaseBucket->query() require the additional parameters as of a particular release?
Thanks!