Error when installing PHP SDK on macOS

I properly run my MySQL database on Apache with PHP 7.1.16 on my macOS 10.13.6.
Today I properly installed couchbase-server-enterprise_6.0.0 the I run some queries on the console. Perfect. Then I tried to install the PHP SDK typing on the Terminal

curl -s | bash -s 7.2
pecl install couchbase

On this last command I got this error

WARNING: channel “” has updated its protocols, use “pecl channel-update” to update
Did not download optional dependencies: pecl/igbinary, use --alldeps to download automatically
pecl/couchbase can optionally use package “pecl/igbinary”
downloading couchbase-2.6.0.tgz …
Starting to download couchbase-2.6.0.tgz (174,067 bytes)
…done: 174,067 bytes
88 source files, building
running: phpize
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
building in /private/tmp/pear/install/pear-build-lorenzopXmPnGA/couchbase-2.6.0
running: /private/tmp/pear/install/couchbase/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for a sed that does not truncate output… /usr/bin/sed
checking for cc… cc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether cc accepts -g… yes
checking for cc option to accept ISO C89… none needed
checking how to run the C preprocessor… cc -E
checking for icc… no
checking for suncc… no
checking whether cc understands -c and -o together… yes
checking for system library directory… lib
checking if compiler supports -R… no
checking if compiler supports -Wl,-rpath,… yes
checking build system type… x86_64-apple-darwin17.7.0
checking host system type… x86_64-apple-darwin17.7.0
checking target system type… x86_64-apple-darwin17.7.0
checking for PHP prefix… /usr
checking for PHP includes… -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory… /usr/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix… /usr/include/php
checking if debug is enabled… no
checking if zts is enabled… no
checking for re2c… no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk… no
checking for nawk… no
checking for awk… awk
checking if awk is broken… no
checking whether to enable Couchbase support… yes, shared
checking wheter to use system FastLZ library… no
checking for libcouchbase in default path… 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/install/couchbase/configure --with-php-config=/usr/bin/php-config’ failed

The phpinfo(); still returns PHP 7.1.16
What should I do?

Hi @Leonardo, the build log includes hint for solution.

checking for libcouchbase in default path… 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/install/couchbase/configure --with-php-config=/usr/bin/php-config’ failed

Did you install libcouchbase? It is available in homebrew:

brew install libcouchbase

Thank you avsej, I did run
brew install libcouchbase
It seems that everything worked well, but I can’t get the php version 7.2 on the phpinfo()
and I can’t use the class CouchbaseCluster.

This is the last part of the log

Libraries have been installed in:

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:

  • add LIBDIR to the `DYLD_LIBRARY_PATH’ environment variable
    during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and manual pages.

Build complete.
Don’t forget to run ‘make test’.

running: make INSTALL_ROOT="/private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0" install
Installing shared extensions: /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0/usr/lib/php/extensions/no-debug-non-zts-20160303/
running: find “/private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0” | xargs ls -dils
17979604 0 drwxr-xr-x 3 leonardop wheel 96 Feb 5 20:32 /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0
17980549 0 drwxr-xr-x 3 leonardop wheel 96 Feb 5 20:32 /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0/usr
17980550 0 drwxr-xr-x 3 leonardop wheel 96 Feb 5 20:32 /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0/usr/lib
17980551 0 drwxr-xr-x 3 leonardop wheel 96 Feb 5 20:32 /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0/usr/lib/php
17980552 0 drwxr-xr-x 3 leonardop wheel 96 Feb 5 20:32 /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0/usr/lib/php/extensions
17980553 0 drwxr-xr-x 3 leonardop wheel 96 Feb 5 20:32 /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0/usr/lib/php/extensions/no-debug-non-zts-20160303
17980554 928 -rwxr-xr-x 1 leonardop wheel 472928 Feb 5 20:32 /private/tmp/pear/install/pear-build-leonardops7h7uP/install-couchbase-2.6.0/usr/lib/php/extensions/no-debug-non-zts-20160303/

Build process completed successfully
Installing ‘/usr/lib/php/extensions/no-debug-non-zts-20160303/’
ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20160303/ (copy(/usr/lib/php/extensions/no-debug-non-zts-20160303/ failed to open stream: Operation not permitted)
Magnifico:~ leonardop$ make test
make: *** No rule to make target `test’. Stop.
Magnifico:~ leonardop$ sudo apachectl stop
Magnifico:~ leonardop$ sudo apachectl start
Magnifico:~ leonardop$ curl -s | bash -s 7.2
Detected macOS High Sierra 10.13. All ok.
Get packager.tgz
Unpack packager.tgz
Please type in your password, as we want to install this into /usr/local
Start packager (may take some time) using /usr/bin/python2.7

Installing package 7.2-10.10-frontenddev into root /
Package 7.2-10.10-frontenddev is already installed at version 7.2.9-20180821-074958. You wanted to install version 7.2.9-20180821-074958.
Magnifico:~ leonardop$ sudo apachectl stop

Then I run
curl -s | bash -s 7.2

Then I stopped and started Apache
sudo apachectl start
sudo apachectl stop

On my php, the phpinfo(); still returns PHP 7.1.16
Also the php line
$myCluster = new CouchbaseCluster(‘couchbase://,,’);
still returns
Fatal error : Uncaught Error: Class ‘CouchbaseCluster’ not found in /Users/leonardop/YouLudiWebSite/php/couchbase.php:7 Stack trace: #0 {main} thrown in

ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20160303/ (copy(/usr/lib/php/extensions/no-debug-non-zts-20160303/ failed to open stream: Operation not permitted)

Maybe it is required to be root to write to /usr/lib/php on your system?

These are the privileges of the directory /usr/lib/php
Magnifico:~ leonardop$ cd /usr/lib/php
Magnifico:php leonardop$ ls -la
total 0
drwxr-xr-x 4 root wheel 128 Feb 8 2018 .
drwxr-xr-x 312 root wheel 9984 Dec 23 18:05 …
drwxr-xr-x 14 root wheel 448 Nov 3 10:25 build
drwxr-xr-x 3 root wheel 96 Feb 8 2018 extensions
Magnifico:php leonardop$

And I didn’t change these permissions. That’s the default on macOS.
The Couchbase engineers should know that.

I tried to run
sudo brew install libcouchbase
and I got this error message
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.

So I did
Magnifico:~ leonardop$ brew reinstall libcouchbase
==> Reinstalling libcouchbase
==> Downloading
Already downloaded: /Users/leonardop/Library/Caches/Homebrew/downloads/31fa86db7a0380371603961259687e8b042a7acf31d5f0c08707e9bb41013a3c–libcouchbase-2.10.3.high_sierra.bottle.tar.gz
==> Pouring libcouchbase-2.10.3.high_sierra.bottle.tar.gz
:beer: /usr/local/Cellar/libcouchbase/2.10.3: 117 files, 3.3MB
Magnifico:~ leonardop$

Nothing changed. Same troubles as before.

The error above comes from pecl install couchbase, so you have to be super-user to modify system paths and install package using sytem PHP interpreter

The quote above again from that log and displays paths where you are installing the extension. Are they correct?

Have you looked at script you were running from It installs PHP into /usr/local/, so I guess you wanted to use that PHP interpreter.

This only proves my point that you are not using interpreter you have installed from Please check FAQ section there:
To fix your problem, you have to be sure that:

  1. you are installing couchbase PHP extension for interpreter you are going to use
  2. apache httpd server also going to use the interpreter you have used to install extensions
  3. when you update php.ini to load the extension, you are using correct file, which used my php module of apache httpd.

Hi avsej,
thank you for your support.
I’m not a system engineer but as you can see on this page
Installation on Mac OS X
brew install libcouchbase
curl -s | bash -s 7.2
pecl install couchbase

It’s not mentioned that you have to run the pecl command as super-user. Also, as we have seen earlier, running this command as root is not allowed. So I copied and pasted the commands, one by one, from the official web site support. And it doesn’t work as expected.

How can I remove everything and install from scratch again?
May you please show me the Terminal command strings one by one?

I paste here the phpinfo() result:


PHP logo
PHP Version 7.1.16

System Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
Build Date Mar 31 2018 02:53:20
Configure Command ‘/BuildRoot/Library/Caches/’ ‘–prefix=/usr’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–disable-dependency-tracking’ ‘–sysconfdir=/private/etc’ ‘–with-libdir=lib’ ‘–enable-cli’ ‘–with-iconv=/BuildRoot/Applications/’ ‘–with-config-file-path=/etc’ ‘–with-libxml-dir=/BuildRoot/Applications/’ ‘–with-openssl=/BuildRoot/Applications/’ ‘–with-kerberos=/BuildRoot/Applications/’ ‘–with-zlib=/BuildRoot/Applications/’ ‘–enable-bcmath’ ‘–with-bz2=/BuildRoot/Applications/’ ‘–enable-calendar’ ‘–disable-cgi’ ‘–with-curl=/BuildRoot/Applications/’ ‘–enable-dba’ ‘–with-ndbm=/BuildRoot/Applications/’ ‘–enable-exif’ ‘–enable-fpm’ ‘–enable-ftp’ ‘–with-gd’ ‘–with-png-dir=/BuildRoot/Library/Caches/’ ‘–with-jpeg-dir=/BuildRoot/Library/Caches/’ ‘–enable-gd-native-ttf’ ‘–with-icu-dir=/BuildRoot/Applications/’ ‘–with-ldap=/BuildRoot/Applications/’ ‘–with-ldap-sasl=/BuildRoot/Applications/’ ‘–with-libedit=/BuildRoot/Applications/’ ‘–enable-mbstring’ ‘–enable-mbregex’ ‘–with-mysqli=mysqlnd’ ‘–with-pcre-regex=/BuildRoot/Applications/’ ‘–without-pcre-jit’ ‘–with-pdo-pgsql=/Applications/’ ‘–with-pgsql=/Applications/’ ‘–without-pear’ ‘–with-pear=no’ ‘–with-pdo-mysql=mysqlnd’ ‘–with-mysql-sock=/var/mysql/mysql.sock’ ‘–disable-phpdbg’ ‘–with-readline=/BuildRoot/Applications/’ ‘–enable-shmop’ ‘–with-snmp=/BuildRoot/Applications/’ ‘–enable-soap’ ‘–enable-sockets’ ‘–enable-sysvmsg’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–with-tidy=/BuildRoot/Applications/’ ‘–enable-wddx’ ‘–with-xmlrpc’ ‘–with-iconv-dir=/BuildRoot/Applications/’ ‘–with-xsl=/BuildRoot/Applications/’ ‘–with-apxs2=/Applications/’ ‘–enable-zip’ ‘YACC=/BuildRoot/Applications/’
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc
Loaded Configuration File (none)
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20160303
PHP Extension 20160303
Zend Extension 320160303
Zend Extension Build API320160303,NTS
PHP Extension Build API20160303,NTS
Debug Build no
Thread Safety disabled
Zend Signal Handling enabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters zlib., bzip2., convert.iconv., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk
Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.1.0, Copyright © 1998-2018 Zend Technologies


Apache Version Apache/2.4.33 (Unix) PHP/7.1.16
Apache API Version 20120211
Server Administrator
User/Group _www(70)/70
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 60 - Keep-Alive: 5
Virtual Server No
Server Root /usr
Loaded Modules core mod_so http_core prefork mod_authn_file mod_authn_core mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_core mod_access_compat mod_auth_basic mod_reqtimeout mod_filter mod_deflate mod_mime mod_log_config mod_env mod_expires mod_headers mod_setenvif mod_version mod_slotmem_shm mod_unixd mod_status mod_autoindex mod_negotiation mod_dir mod_alias mod_rewrite mod_php7 mod_hfs_apple2
Directive Local Value Master Value
engine 1 1
last_modified 0 0
xbithack 0 0
Apache Environment

Variable Value
HTTP_HOST localhost
HTTP_COOKIE kSQL_DB_Version=126; visitorLanguage=it; searchUsernameInUsersList=; PHPSESSID=5467cd09697813c6db3a8f7a4d5eafc7; visitorCountryCode=it
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
PATH /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE Apache/2.4.33 (Unix) PHP/7.1.16
SERVER_NAME localhost
DOCUMENT_ROOT /Users/leonardop/MyWebSite
CONTEXT_DOCUMENT_ROOT /Users/leonardop/MyWebSite
SCRIPT_FILENAME /Users/leonardop/MyWebSite/php/php_info.php
REQUEST_URI /php/php_info.php
SCRIPT_NAME /php/php_info.php
HTTP Headers Information

HTTP Request Headers
HTTP Request GET /php/php_info.php HTTP/1.1
Host localhost
Cookie kSQL_DB_Version=126; visitorLanguage=it; searchUsernameInUsersList=; PHPSESSID=5467cd09697813c6db3a8f7a4d5eafc7; visitorCountryCode=it
Connection keep-alive
Upgrade-Insecure-Requests 1
Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15
Accept-Language en-us
Accept-Encoding gzip, deflate
HTTP Response Headers
X-Powered-By PHP/7.1.16

BCMath support enabled
Directive Local Value Master Value
bcmath.scale 0 0

BZip2 Support Enabled
Stream Wrapper support compress.bzip2://
Stream Filter support bzip2.decompress, bzip2.compress
BZip2 Version 1.0.6, 6-Sept-2010

Calendar support enabled

PHP Version 7.1.16
Directive Local Value Master Value
allow_url_fopen On On
allow_url_include Off Off
arg_separator.input & &
arg_separator.output & &
auto_append_file no value no value
auto_globals_jit On On
auto_prepend_file no value no value
browscap no value no value
default_charset UTF-8 UTF-8
default_mimetype text/html text/html
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
enable_post_data_reading On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting no value no value
expose_php On On
extension_dir /usr/lib/php/extensions/no-debug-non-zts-20160303 /usr/lib/php/extensions/no-debug-non-zts-20160303
file_uploads On On
hard_timeout 2 2
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .: .:
input_encoding no value no value
internal_encoding no value no value
log_errors Off Off
log_errors_max_len 1024 1024
mail.add_x_header Off Off
mail.force_extra_parameters no value no value
mail.log no value no value
max_execution_time 180 30
max_file_uploads 20 20
max_input_nesting_level 64 64
max_input_time 180 -1
max_input_vars 1000 1000
memory_limit 512M 128M
open_basedir no value no value
output_buffering 0 0
output_encoding no value no value
output_handler no value no value
post_max_size 64M 8M
precision 14 14
realpath_cache_size 4096K 4096K
realpath_cache_ttl 120 120
register_argc_argv On On
report_memleaks On On
report_zend_debug On On
request_order no value no value
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision -1 -1
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
sys_temp_dir no value no value
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 256M 2M
upload_tmp_dir no value no value
user_dir no value no value
user_ini.cache_ttl 300 300
user_ini.filename .user.ini .user.ini
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
zend.assertions 1 1
zend.detect_unicode On On
zend.enable_gc On On
zend.multibyte Off Off
zend.script_encoding no value no value
zend.signal_check Off Off

ctype functions enabled

cURL support enabled
cURL Information 7.54.0
Age 3
AsynchDNS Yes
CharConv No
Debug No
GSS-Negotiate No
IPv6 Yes
krb4 No
Largefile Yes
libz Yes
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host x86_64-apple-darwin17.0
SSL Version LibreSSL/2.0.20
ZLib Version 1.2.11

date/time support enabled
timelib version 2016.05
“Olson” Timezone Database Version 2018.3
Timezone Database internal
Default timezone Europe/Paris
Directive Local Value Master Value
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.583333 90.583333
date.sunset_zenith 90.583333 90.583333
date.timezone no value no value

DBA support enabled
Supported handlers ndbm cdb cdb_make inifile flatfile
Directive Local Value Master Value
dba.default_handler flatfile flatfile

DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.9.4
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled

EXIF Support enabled
EXIF Version 7.1.16
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF
Directive Local Value Master Value
exif.decode_jis_intel JIS JIS
exif.decode_jis_motorola JIS JIS
exif.decode_unicode_intel UCS-2LE UCS-2LE
exif.decode_unicode_motorola UCS-2BE UCS-2BE
exif.encode_jis no value no value
exif.encode_unicode ISO-8859-15 ISO-8859-15

fileinfo support enabled
version 1.0.5
libmagic 522

Input Validation and Filtering enabled
Revision Id: a4ca1e0a99c260cb8a4cf5d7369d130f7b934185
Directive Local Value Master Value
filter.default unsafe_raw unsafe_raw
filter.default_flags no value no value

FTP support enabled
FTPS support enabled

GD Support enabled
GD Version bundled (2.1.0 compatible)
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 9 compatible
PNG Support enabled
libPNG Version 1.6.32
WBMP Support enabled
XBM Support enabled
Directive Local Value Master Value
gd.jpeg_ignore_warning 1 1

hash support enabled
Hashing Engines md2 md4 md5 sha1 sha224 sha256 sha384 sha512/224 sha512/256 sha512 sha3-224 sha3-256 sha3-384 sha3-512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b fnv132 fnv1a32 fnv164 fnv1a64 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

iconv support enabled
iconv implementation libiconv
iconv library version 1.11
Directive Local Value Master Value
iconv.input_encoding no value no value
iconv.internal_encoding no value no value
iconv.output_encoding no value no value

json support enabled
json version 1.5.0

LDAP Support enabled
RCS Version Id: 8dbea0c3ba11210a36d586df44ad9e6af14809c4
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version 20428
SASL Support Enabled
Directive Local Value Master Value
ldap.max_links Unlimited Unlimited

libXML support active
libXML Compiled Version 2.9.4
libXML Loaded Version 20904
libXML streams enabled

Multibyte Support enabled
Multibyte string engine libmbfl
HTTP input encoding translation disabled
libmbfl version 1.3.2
oniguruma version 5.9.6
mbstring extension makes use of “streamable kanji code filter and converter”, which is distributed under the GNU Lesser General Public License version 2.1.
Multibyte (japanese) regex support enabled
Multibyte regex (oniguruma) backtrack check On
Multibyte regex (oniguruma) version 5.9.6
Directive Local Value Master Value
mbstring.detect_order no value no value
mbstring.encoding_translation Off Off
mbstring.func_overload 0 0
mbstring.http_input no value no value
mbstring.http_output no value no value
mbstring.http_output_conv_mimetypes ^(text/|application/xhtml+xml) ^(text/|application/xhtml+xml)
mbstring.internal_encoding no value no value
mbstring.language uni neutral
mbstring.strict_detection Off Off
mbstring.substitute_character no value no value

MysqlI Support enabled
Client API library version mysqlnd 5.0.12-dev - 20150407 - Id: 38fea24f2847fa7519001be390c98ae0acafe387
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0
Directive Local Value Master Value
mysqli.allow_local_infile On On
mysqli.allow_persistent On On
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket /var/mysql/mysql.sock /var/mysql/mysql.sock
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.max_persistent Unlimited Unlimited
mysqli.reconnect Off Off
mysqli.rollback_on_cached_plink Off Off

mysqlnd enabled
Version mysqlnd 5.0.12-dev - 20150407 - Id: 38fea24f2847fa7519001be390c98ae0acafe387
Compression supported
core SSL supported
extended SSL supported
Command buffer size 4096
Read buffer size 32768
Read timeout 31536000
Collecting statistics Yes
Collecting memory statistics No
Tracing n/a
Loaded plugins mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password
API Extensions pdo_mysql,mysqli
mysqlnd statistics
bytes_sent 0
bytes_received 0
packets_sent 0
packets_received 0
protocol_overhead_in 0
protocol_overhead_out 0
bytes_received_ok_packet 0
bytes_received_eof_packet 0
bytes_received_rset_header_packet 0
bytes_received_rset_field_meta_packet 0
bytes_received_rset_row_packet 0
bytes_received_prepare_response_packet 0
bytes_received_change_user_packet 0
packets_sent_command 0
packets_received_ok 0
packets_received_eof 0
packets_received_rset_header 0
packets_received_rset_field_meta 0
packets_received_rset_row 0
packets_received_prepare_response 0
packets_received_change_user 0
result_set_queries 0
non_result_set_queries 0
no_index_used 0
bad_index_used 0
slow_queries 0
buffered_sets 0
unbuffered_sets 0
ps_buffered_sets 0
ps_unbuffered_sets 0
flushed_normal_sets 0
flushed_ps_sets 0
ps_prepared_never_executed 0
ps_prepared_once_executed 0
rows_fetched_from_server_normal 0
rows_fetched_from_server_ps 0
rows_buffered_from_client_normal 0
rows_buffered_from_client_ps 0
rows_fetched_from_client_normal_buffered 0
rows_fetched_from_client_normal_unbuffered 0
rows_fetched_from_client_ps_buffered 0
rows_fetched_from_client_ps_unbuffered 0
rows_fetched_from_client_ps_cursor 0
rows_affected_normal 0
rows_affected_ps 0
rows_skipped_normal 0
rows_skipped_ps 0
copy_on_write_saved 0
copy_on_write_performed 0
command_buffer_too_small 0
connect_success 0
connect_failure 0
connection_reused 0
reconnect 0
pconnect_success 0
active_connections 0
active_persistent_connections 0
explicit_close 0
implicit_close 0
disconnect_close 0
in_middle_of_command_close 0
explicit_free_result 0
implicit_free_result 0
explicit_stmt_close 0
implicit_stmt_close 0
mem_emalloc_count 0
mem_emalloc_amount 0
mem_ecalloc_count 0
mem_ecalloc_amount 0
mem_erealloc_count 0
mem_erealloc_amount 0
mem_efree_count 0
mem_efree_amount 0
mem_malloc_count 0
mem_malloc_amount 0
mem_calloc_count 0
mem_calloc_amount 0
mem_realloc_count 0
mem_realloc_amount 0
mem_free_count 0
mem_free_amount 0
mem_estrndup_count 0
mem_strndup_count 0
mem_estrdup_count 0
mem_strdup_count 0
mem_edupl_count 0
mem_dupl_count 0
proto_text_fetched_null 0
proto_text_fetched_bit 0
proto_text_fetched_tinyint 0
proto_text_fetched_short 0
proto_text_fetched_int24 0
proto_text_fetched_int 0
proto_text_fetched_bigint 0
proto_text_fetched_decimal 0
proto_text_fetched_float 0
proto_text_fetched_double 0
proto_text_fetched_date 0
proto_text_fetched_year 0
proto_text_fetched_time 0
proto_text_fetched_datetime 0
proto_text_fetched_timestamp 0
proto_text_fetched_string 0
proto_text_fetched_blob 0
proto_text_fetched_enum 0
proto_text_fetched_set 0
proto_text_fetched_geometry 0
proto_text_fetched_other 0
proto_binary_fetched_null 0
proto_binary_fetched_bit 0
proto_binary_fetched_tinyint 0
proto_binary_fetched_short 0
proto_binary_fetched_int24 0
proto_binary_fetched_int 0
proto_binary_fetched_bigint 0
proto_binary_fetched_decimal 0
proto_binary_fetched_float 0
proto_binary_fetched_double 0
proto_binary_fetched_date 0
proto_binary_fetched_year 0
proto_binary_fetched_time 0
proto_binary_fetched_datetime 0
proto_binary_fetched_timestamp 0
proto_binary_fetched_string 0
proto_binary_fetched_json 0
proto_binary_fetched_blob 0
proto_binary_fetched_enum 0
proto_binary_fetched_set 0
proto_binary_fetched_geometry 0
proto_binary_fetched_other 0
init_command_executed_count 0
init_command_failed_count 0
com_quit 0
com_init_db 0
com_query 0
com_field_list 0
com_create_db 0
com_drop_db 0
com_refresh 0
com_shutdown 0
com_statistics 0
com_process_info 0
com_connect 0
com_process_kill 0
com_debug 0
com_ping 0
com_time 0
com_delayed_insert 0
com_change_user 0
com_binlog_dump 0
com_table_dump 0
com_connect_out 0
com_register_slave 0
com_stmt_prepare 0
com_stmt_execute 0
com_stmt_send_long_data 0
com_stmt_close 0
com_stmt_reset 0
com_stmt_set_option 0
com_stmt_fetch 0
com_deamon 0
bytes_received_real_data_normal 0
bytes_received_real_data_ps 0

OpenSSL support enabled
OpenSSL Library Version LibreSSL 2.2.7
OpenSSL Header Version LibreSSL 2.2.7
Openssl default config /private/etc/ssl/openssl.cnf
Directive Local Value Master Value
openssl.cafile no value no value
openssl.capath no value no value

PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 8.40 2017-01-11
PCRE JIT Support not compiled in
Directive Local Value Master Value
pcre.backtrack_limit 1000000 1000000
pcre.recursion_limit 100000 100000

PDO support enabled
PDO drivers mysql, pgsql, sqlite

PDO Driver for MySQL enabled
Client API version mysqlnd 5.0.12-dev - 20150407 - Id: 38fea24f2847fa7519001be390c98ae0acafe387
Directive Local Value Master Value
pdo_mysql.default_socket /var/mysql/mysql.sock /var/mysql/mysql.sock

PDO Driver for PostgreSQL enabled
PostgreSQL(libpq) Version 9.3.7
Module version 7.1.16
Revision Id: 9c5f356c77143981d2e905e276e439501fe0f419

PDO Driver for SQLite 3.x enabled
SQLite Library 3.15.1

PostgreSQL Support enabled
PostgreSQL(libpq) Version 9.3.7
PostgreSQL(libpq) PostgreSQL 9.3.7 on x86_64-apple-darwin17.0, compiled by Apple LLVM version 9.0.0 (clang-900.0.31), 64-bit
Multibyte character support enabled
SSL support disabled
Active Persistent Links 0
Active Links 0
Directive Local Value Master Value
pgsql.allow_persistent On On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice Off Off
pgsql.max_links Unlimited Unlimited
pgsql.max_persistent Unlimited Unlimited

Phar: PHP Archive support enabled
Phar EXT version 2.0.2
Phar API version 1.1.1
SVN revision Id: 898d1dac303a2eedebae7b6c8fa859253b781100
Phar-based phar archives enabled
Tar-based phar archives enabled
ZIP-based phar archives enabled
gzip compression enabled
bzip2 compression enabled
OpenSSL support enabled
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright © 2003-2009 Tim Kientzle.
Directive Local Value Master Value
phar.cache_list no value no value
phar.readonly On On
phar.require_hash On On

Revision Id: 066139df29f2b6954fc80149a0ba49dd7845ef7b

Reflection enabled
Version Id: 7c6e20c07e8435a5148263b349668853c0057575

Session Support enabled
Registered save handlers files user
Registered serializer handlers php_serialize php php_binary wddx
Directive Local Value Master Value
session.auto_start Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.lazy_write On On PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path no value no value
session.serialize_handler php php
session.sid_bits_per_character 4 4
session.sid_length 32 32
session.upload_progress.cleanup On On
session.upload_progress.enabled On On
session.upload_progress.freq 1% 1%
session.upload_progress.prefix upload_progress_ upload_progress_
session.use_cookies On On
session.use_only_cookies On On
session.use_strict_mode Off Off
session.use_trans_sid 0 0

shmop support enabled

Simplexml support enabled
Revision Id: ae067cdcddf424d6e762603905b98798bc924a00
Schema support enabled

NET-SNMP Support enabled
NET-SNMP Version
PHP SNMP Version 0.1

Soap Client enabled
Soap Server enabled
Directive Local Value Master Value
soap.wsdl_cache 1 1
soap.wsdl_cache_dir /tmp /tmp
soap.wsdl_cache_enabled 1 1
soap.wsdl_cache_limit 5 5
soap.wsdl_cache_ttl 86400 86400

Sockets Support enabled

SPL support enabled
Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

SQLite3 support enabled
SQLite3 module version 7.1.16
SQLite Library 3.15.1
Directive Local Value Master Value
sqlite3.extension_dir no value no value

Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i
Directive Local Value Master Value 1 1
assert.bail 0 0
assert.callback no value no value
assert.exception 0 0
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 60 60
from no value no value
session.trans_sid_hosts no value no value
session.trans_sid_tags a=href,area=href,frame=src,form= a=href,area=href,frame=src,form=
url_rewriter.hosts no value no value
url_rewriter.tags form= form=
user_agent no value no value

sysvmsg support enabled
Revision Id: 483c70b5c54718693a4b95633a097e33d1120ba9

Version 7.1.16

Version 7.1.16

Tidy support enabled
libTidy Release 31 October 2006 - Apple Inc. build 15.18.1
Extension Version 7.1.16 (Id: c6d6b80d55c5d351deaa745c3c540971e5583c24 )
Directive Local Value Master Value
tidy.clean_output 0 0
tidy.default_config no value no value

Tokenizer Support enabled

WDDX Support enabled
WDDX Session Serializer enabled

XML Support active
XML Namespace Support active
libxml2 Version 2.9.4

XMLReader enabled

core library version xmlrpc-epi v. 0.51
php extension version 7.1.16
author Dan Libby
open sourced by

XMLWriter enabled

XSL enabled
libxslt Version 1.1.29
libxslt compiled against libxml Version 2.9.4
EXSLT enabled
libexslt Version 1.1.29

Zip enabled
Zip version 1.13.5
Libzip version 1.1.2

ZLib Support enabled
Stream Wrapper compress.zlib://
Stream Filter zlib.inflate, zlib.deflate
Compiled Version 1.2.11
Linked Version 1.2.11
Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value
Additional Modules

Module Name

Variable Value
PATH /usr/bin:/bin:/usr/sbin:/sbin
PHP Variables

Variable Value
_REQUEST['PHPSESSID'] 5467cd09697813c6db3a8f7a4d5eafc7 _SERVER[‘HTTP_HOST’] localhost
_SERVER['HTTP_COOKIE'] PHPSESSID=5467cd09697813c6db3a8f7a4d5eafc7; _SERVER[‘HTTP_CONNECTION’] keep-alive
_SERVER['HTTP_UPGRADE_INSECURE_REQUESTS'] 1 _SERVER[‘HTTP_ACCEPT’] text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
_SERVER['HTTP_USER_AGENT'] Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15 _SERVER[‘HTTP_ACCEPT_LANGUAGE’] en-us
_SERVER['PATH'] /usr/bin:/bin:/usr/sbin:/sbin _SERVER[‘SERVER_SIGNATURE’] no value
_SERVER['SERVER_SOFTWARE'] Apache/2.4.33 (Unix) PHP/7.1.16 _SERVER[‘SERVER_NAME’] localhost
_SERVER['REMOTE_ADDR'] ::1 _SERVER[‘DOCUMENT_ROOT’] /Users/leonardop/MyWebSite
_SERVER['SCRIPT_FILENAME'] /Users/leonardop/MyWebSite/php/php_info.php _SERVER[‘REMOTE_PORT’] 49461
_SERVER['REQUEST_URI'] /php/php_info.php _SERVER[‘SCRIPT_NAME’] /php/php_info.php
_SERVER['PHP_SELF'] /php/php_info.php _SERVER[‘REQUEST_TIME_FLOAT’] 1549409322.682
_SERVER['REQUEST_TIME'] 1549409322 _SERVER[‘argv’]
_SERVER['argc'] 0 _ENV[‘PATH’] /usr/bin:/bin:/usr/sbin:/sbin
PHP Credits

It was homebrew, which did not allow you to run as root:

It seems like you are treating libcouchbase as PHP extension, but it is not. It is library which exposes C interfaces. We ship PHP module using PECL and it depends on libcouchbase.

We don’t maintain any of the PHP distributions on any of the existing platforms. So we cannot cover questions like whether or not the user need to be root during extension deployment, or where the proper pecl command installed. The FAQ I’ve pointed above ( have this question. Have you tried what the answer recommends?


I strongly recommend you to read through details on how their PHP distribution works, where the configs stored and how it works with your webserver. On my side, I can help you with any questions related the couchbase extension.

I could even use Couchbase with my current php 7.1.6 if allowed. But it won’t work. So the problem doesn’t come from pecl nor from the php 7.2 installation.

I’m a macOS client developer for 20 years, I’m not a system expert but usually I install and configure everything with Terminal. MySQL and php are working since the first easy and quick installation.

The Couchbase official support page say to just run these commands
brew install libcouchbase
curl -s | bash -s 7.2
pecl install couchbase

Then you say toI should rather use
sudo pecl install couchbase

So the official support information are not correct. You are very kind but the Couchbase company organisation is not so professional.

On Mac you run an installer and everything works at the first try. Couchbase doesn’t belong to this philosophy. One year ago I attended to a Couchbase conference, then I tried to install Couchbase and I spent one week in pain and frustrations, unsuccessfully. This week I decided to dedicate a few hours more to install Couchbase and give it a chance, but again I’m here stuck for 3 days struggling myself.

Couchbase engineers/management should avoid this bottleneck to the new clients. If they cut potential customers at the entrance they lose business. There should be an installer, double click and go. No more. That’s the macOS philosophy.
A software company can’t say “If it doesn’t work on your system it’s up to you”. A software company should sell a product that always works on that system.
I stay with my SQL/PHP/JavaScript system. If this is the beginning I won’t imagine the future. Thank you. You are kind. It’s the product and the company philosophy that don’t work. Couchbase is probably made for top level system engineers only.

I didn’t say that. The documentation page now updated. You have to use the way you use to install other pecl extensions. We don’t do anything special for couchbase. The process exactly the same as for other pecl extensions.

But I see you don’t want to control the process. In this case you can run this in MacOS recovery mode:

csrutil disable

Reboot, and run this script in terminal

curl -sSL | sudo bash -s

After that you will have installed couchbase extension in your sytem’s PHP interpreter.

Hi avsej
it’s not that I don’t want to control the process, simply I’m not able.

I had already run
csrutil disable
and rebooted. 5 minutes ago I did it again and rebooted the machine. Then I did as you say
curl -sSL | sudo bash -s
and this is the result:

Last login: Wed Feb 6 18:04:50 on console
Magnifico:~ leonardop$ curl -sSL | sudo bash -s
: No such file or directory
: ambiguous redirect
: ambiguous redirect
: ambiguous redirect
: No such file or directory-2.6.0
: ambiguous redirect
: ambiguous redirect
: ambiguous redirect
: ambiguous redirect
: ambiguous redirect
: command not found

Warning: PHP Startup: Unable to load dynamic library ‘’ (tried: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/ (dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/, 9): image not found), /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/ (dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/, 9): image not found)) in Unknown on line 0
Standard input code:1:
class Couchbase\Cluster#1 (2) {
public $connstr =>
string(21) “couchbase://localhost”
public authenticator => NULL } Magnifico:~ leonardop

I put this web address on my browser and I saw
cd /tmp brew install libcouchbase autoconf >/dev/null 2>&1 curl -L -s -o couchbase-2.6.0.tar.gz >/dev/null 2>&1 tar xf couchbase-2.6.0.tar.gz >/dev/null 2>&1 cd couchbase-2.6.0 /usr/bin/phpize >/dev/null 2>&1 ./configure --with-couchbase >/dev/null 2>&1 make -j8 >/dev/null 2>&1 sudo make install 2>&1 echo “” | sudo tee -a /etc/php.ini >/dev/null 2>&1 cd echo ‘<?php var_dump(new \Couchbase\Cluster(“couchbase://localhost”));’ | php

That is strange, when you strip all >/dev/null 2>&1 from the commands. Where does it stop?

set -xe

cd /tmp
brew install libcouchbase autoconf
curl -L -s -o couchbase-2.6.0.tar.gz
tar xf couchbase-2.6.0.tar.gz

cd couchbase-2.6.0
./configure --with-couchbase
make -j8
sudo make install
echo "" | sudo tee -a /etc/php.ini

echo '<?php var_dump(new \Couchbase\Cluster("couchbase://localhost"));' | php

avsej, forget. I will ask a colleague of mine. For me it’s too complicated.
Thank you anyway.