1

my env is macos M1 core.
php version: 5.6
I done this: brew install libcouchbase and also libcouchbase@2 installed. and I cant install the php couchbase extension.

I treid: pecl install https://pecl.php.net/get/couchbase-2.6.0.tgz
It return:

checking for unistd.h... yes
checking for libcouchbase/couchbase.h... no

./internal.h:57:10: fatal error: 'libcouchbase/couchbase.h' file not found
#include <libcouchbase/couchbase.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~

Any ideas? reinstall libcouchbase is not worded.

吴伟民
  • 21
  • 2

1 Answers1

1

I solved it!

  1. wget https://pecl.php.net/get/couchbase-2.6.0.tgz
  2. tar -xvf couchbase-2.6.0.tgz
  3. cd couchbase-2.6.0
  4. sudo phpize
  5. sudo ./configure --with-php-config=php-config CPPFLAGS="-I/opt/homebrew/Cellar/libcouchbase@2/include" LDFLAGS="-L/opt/homebrew/opt/libcouchbase@2/lib"
  6. sudo make && make install

NOTE: Step 5 is most important!

thorne51
  • 588
  • 7
  • 23
吴伟民
  • 21
  • 2