I have wasted 1.5 days to make the current Couchbase SDK work on my Windows machine with WAMP and PHP 7.0.4 (x86 thread-safe - build date Mar 2 2016 14:40:59) and found a solution.
I have tried to install the Couchbase PHP extension from http://developer.couchbase.com/server/other-products/release-notes-archives/php-sdk by downloading the proper versions of the extensions, putting them in PHP/ext folders and adding extension=php_couchbase.dll to PHP.INI
At first the print_r(get_loaded_extensions()) instruction did NOT show the couchbase extension as loaded. It also didn’t show as loaded in php_info().
The PHP error log showed things like:
[18-Jul-2016 07:55:17 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘c:/wamp/bin/php/php7.0.4/ext/php_couchbase.dll’ - The specified module could not be found.
in Unknown on line 0
There are 2 files: php_couchbase.dll and libcouchbase.dll
The php_couchbase.dll is the PHP extension, and it depends on libcouchbase.dll. Unfortunately, it does NOT know how to load the libcouchbase.dll from the location from where php_couchbase.dll itself is stored. This is a problem which could probably be fixed very easily by the extension developers.
The solution I found is to copy libcouchbase.dll to the c:\wamp\bin\apache\apache2.4.18\bin folder. This is probably the current directory into which Apache (and PHP) runs, and by moving libcouchbase.dll there, the php_couchbase.dll extension can find the DLL there, and loads properly.
After copying libcouchbase.dll to that folder, the couchbase extension works properly. The phpinfo() shows something like:
couchbase support: enabled
extension version: 2.2.0
libcouchbase runtime version: 2.6.1 (git: eb09707433013b742c0aa221e564ad73ba8a3708)
libcouchbase headers version: 2.6.1 (git: eb09707433013b742c0aa221e564ad73ba8a3708)
Also, all examples work, the CouchbaseCluster class can be instantiated, etc.
The Couchbase PHP extension developers should fix this. Even if it’s a minor problem, it is important because PHP is the most popular programming language for the web. Making Couchbase work with PHP (and other popular languages) without wasting days configuring it should be a top priority. Other databases such as MySQL and MS SQL Server do NOT require spending 2 days struggling to configure a simple PHP extension. This should work flawlessly.