简体   繁体   中英

MacOs M1 env cant install php-ext couchbase

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM