When I did run the command
$ php --ini
I got
PHP Warning: Module ‘couchbase’ already loaded in Unknown on line 0
So I have just removed the string extension=couchbase.so from my php.ini file and I restarted with
$ sudo apachectl -k restart
and run
$ php --ini
And now I don’t get that warning longer.
Configuration File (php.ini) Path: /usr/local/etc/php/7.0
Loaded Configuration File: /usr/local/etc/php/7.0/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.0/conf.d/ext-couchbase.ini,
/usr/local/etc/php/7.0/conf.d/ext-igbinary.ini
Then
$ php -i
phpinfo()
PHP Version => 7.0.23
Then
$ whereis php
/usr/bin/php
But the file /usr/bin/php-config is strangely configured to php 5.624 ! It contains
#! /bin/sh
SED="/usr/bin/sed"
prefix="/usr"
datarootdir="/usr/php"
exec_prefix="${prefix}"
version="5.6.24"
vernum=“50624”
Furthermore, the dir /usr/php doesn’t exist.
So maybe the trouble comes from that.
Anyway, just to complete the info, my php sample is the one I copied from the couchbase web page
https://developer.couchbase.com/documentation/server/current/sdk/php/start-using-sdk.html
It is located at: http: // localhost / couchbase dot php and it contains just
(I put the spaces in the URL because I can’t write more than 2 links here).
<?php
$myCluster = new CouchbaseCluster('couchbase://127.0.0.1:8091');
// Same error here
//$myCluster = new \Couchbase\Cluster('couchbase://127.0.0.1:8091');
// Always false
if (class_exists('CouchbaseCluster')) {
echo 'CouchbaseCluster exists';
}
else{
echo "CouchbaseCluster doesn't exist";
return;
}
?>
If I echo phpinfo(); from the file localhost/phpinfo.php
I get
++++++
PHP Version 7.0.23
php-osx.liip dot ch by Liip (originally developed by www.local dot ch)
Darwin leonardo.local 16.0.0 Darwin Kernel Version 16.0.0: Mon Aug 29 17:56:20 PDT 2016; root:xnu-3789.1.32~3/RELEASE_X86_64 x86_64
Build Date Sep 14 2017 09:50:51
Configure Command ‘./configure’ ‘–prefix=/usr/local/php5’ ‘–with-apxs2=/usr/sbin/apxs’ ‘–with-config-file-scan-dir=/usr/local/php5/php.d’ ‘–with-libxml-dir=shared,/usr’ ‘–with-openssl=/usr/local/php5’ ‘–with-zlib=/usr’ ‘–with-zlib-dir=/usr’ ‘–with-gd’ ‘–with-ldap’ ‘–with-xmlrpc’ ‘–enable-exif’ ‘–enable-soap’ ‘–enable-wddx’ ‘–enable-ftp’ ‘–with-iodbc’ ‘–enable-sockets’ ‘–with-bz2=/usr’ ‘–enable-zip’ ‘–enable-shmop’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-sysvmsg’ ‘–enable-mbstring’ ‘–enable-bcmath’ ‘–enable-calendar’ ‘–with-mhash’ ‘–enable-fpm’ ‘–with-mysql=mysqlnd’ ‘–with-mysqli=mysqlnd’ ‘–with-pdo-mysql=mysqlnd’ ‘–enable-pcntl’ ‘–enable-dtrace’ ‘–disable-phpdbg’ ‘–enable-opcache’ ‘–with-icu-dir=/usr/local/php5’ ‘–with-xsl=shared,/usr/local/php5’ ‘–with-imap=shared,…/imap-2007f’ ‘–with-kerberos=/usr’ ‘–with-imap-ssl=/usr/local/php5’ ‘–with-gettext=/usr/local/php5’ ‘–with-curl=shared,/usr/local/php5’ ‘–with-png-dir=/usr/local/php5’ ‘–with-jpeg-dir=/usr/local/php5’ ‘–enable-gd-native-ttf’ ‘–with-freetype-dir=/usr/local/php5’ ‘–with-pgsql=shared,/usr/local/php5’ ‘–with-pdo-pgsql=shared,/usr/local/php5’ ‘–with-mcrypt=shared,/usr/local/php5’ ‘–with-tidy=/usr/local/php5’ ‘–with-gmp=shared,/usr/local/php5’ ‘–with-readline=shared,/usr/local/php5’ ‘–with-libxml-dir=/usr/local/php5’ ‘CFLAGS=-Os ‘-mmacosx-version-min=10.10’ ‘-I/usr/local/php5/include’ ‘-arch’ ‘-no-cpp-precomp’ ‘-DENTROPY_CH_ARCHS=’’‘i386/x86_64’’’’ ‘-DENTROPY_CH_RELEASE=1’’ 'YACC=/usr/local/Cellar/bison/3.0.2/bin/bison ‘-y’'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/php5/lib
Loaded Configuration File /usr/local/php5/lib/php.ini
Scan this dir for additional .ini files /usr/local/php5/php.d
Additional .ini files parsed /usr/local/php5/php.d/10-extension_dir.ini, /usr/local/php5/php.d/20-extension-opcache.ini, /usr/local/php5/php.d/40-curl.ini, /usr/local/php5/php.d/40-openssl.ini, /usr/local/php5/php.d/50-extension-apcu.ini, /usr/local/php5/php.d/50-extension-curl.ini, /usr/local/php5/php.d/50-extension-gmp.ini, /usr/local/php5/php.d/50-extension-igbinary.ini, /usr/local/php5/php.d/50-extension-imap.ini, /usr/local/php5/php.d/50-extension-intl.ini, /usr/local/php5/php.d/50-extension-mcrypt.ini, /usr/local/php5/php.d/50-extension-memcached.ini, /usr/local/php5/php.d/50-extension-mongodb.ini, /usr/local/php5/php.d/50-extension-mssql.ini, /usr/local/php5/php.d/50-extension-pdo_pgsql.ini, /usr/local/php5/php.d/50-extension-pgsql.ini, /usr/local/php5/php.d/50-extension-propro.ini, /usr/local/php5/php.d/50-extension-raphf.ini, /usr/local/php5/php.d/50-extension-readline.ini, /usr/local/php5/php.d/50-extension-redis.ini, /usr/local/php5/php.d/50-extension-solr.ini, /usr/local/php5/php.d/50-extension-ssh2.ini, /usr/local/php5/php.d/50-extension-xdebug.ini, /usr/local/php5/php.d/50-extension-xsl.ini, /usr/local/php5/php.d/60-extension-pecl_http.ini, /usr/local/php5/php.d/99-liip-developer.ini
++++++
I can’t upload the whole document because I am new here and I can’t upload attachments.
Please feel free to ask me for any further information.
Thank you.