Hi there.
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 --with-php-config=/opt/homebrew/opt/php@7.4/bin/php-config' failed
I installed libcouchbase via Homebrew, then I tried running: pecl install couchbase and got that error.
Hello @beitomartinez sorry for the delay, were you able to figure this out ?
Today I tried it on macOs and had not complaints. I tried installing the latest of PHP and libcouchbase and had no complaints. Are you trying to do the same ?
Hi!
A colleague helped me solved it.
It was an issue with the M1 processor. I had to run my terminal on rosetta2 and reinstall everything (brew, php) in order for it to work.
Edit config.m4 file and go to line 29.
This code block should follow:
dnl fallback on standard directory
else
for i in /usr/local /usr; do
if test -r $i/include/libcouchbase/couchbase.h; then
LIBCOUCHBASE_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
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:
phpize
./configure --with-couchbase
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.