I’m trying to install the PHP SDK on my mac.
But I always get the following error:
checking for libcouchbase... not found
configure: error: Please reinstall the libcouchbase distribution -
libcouchbase.h should be <libcouchbase-dir>/include and
libcouchbase.a should be in <libcouchbase-dir>/lib
ERROR: `/private/tmp/pear/temp/couchbase/configure --firstname.lastname@example.org/bin/php-config' failed
I installed libcouchbase via Homebrew, then I tried running: pecl install couchbase and got that error.
Edit config.m4 file and go to line 29.
This code block should follow:
dnl fallback on standard directory
for i in /usr/local /usr; do
if test -r $i/include/libcouchbase/couchbase.h; then
AC_MSG_RESULT(found in $i)
I changed the ‘for i in /usr/local /usr; do’ in ‘for i in /opt/homebrew; do’
Then I followed the instructions from github to build from sources:
make && make install
Hope this helps.
I had to do this when I got my MacBook Air a few months ago and again now trying to install it on a new MacBook Pro.
Maybe the installer should be updated to look also in /opt/homebrew?
Or maybe there is a better way to tell the installer where to look?
In the config.m4 file there is also a check for $PHP_COUCHBASE directory but I have no idea how to set it - or if it can be set in terminal before running pecl install couchbase etc to avoid building from source.