The Couchbase extension for PHP 7.x doesn't work at all on Windows Server 2016 Technical Preview 5

I have been trying to get the couchbase extension for PHP 7.x to work on Windows Server 2016 Technical Preview 5.

I used the latest version of the extension from http://developer.couchbase.com/server/other-products/release-notes-archives/php-sdk

When I add the line:

extension=php_couchbase.dll

to PHP.INI, the PHP executable (no matter whether it’s PHP.EXE or PHP-CGI.EXE) crashes. I have made sure that I downloaded the correct version of the extension (I use the 64-bit non-thread-safe PHP 7 and the 64-bit non-thread-safe extension). The libcouchbase.dll file is somewhere in the PATH, so it should load.

In fact I have performed multiple experiments, including installing the 32-bit Couchbase extension for PHP 7.x 32-bit, and copying the PHP 7.x + Couchbase extension which works on my Windows 7 machine. Nothing worked. No matter which version I tried and what I did, PHP 7.x crashes when trying to load the Couchbase PHP extension on Windows Server 2016 Technical Preview 5. I have checked the PHP error log, and nothing appears in that log.

I have examined the Couchbase PHP extension using HIEW by Eugene Suslikov to find out which DLL files are used:

PHP_COUCHBASE.DLL links to these DLL files:
PHP7.dll
libcouchbase.dll
VCRUNTIME140.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
KERNEL32.dll

LIBCOUCHBASE.DLL links to these DLL files:
KERNEL32.dll
WS2_32.dll
MSVCR110.dll
MSVCP110.dll

VCRUNTIME140.dll is included in the Visual C++ 2015 redistributable from
https://www.microsoft.com/en-us/download/details.aspx?id=48145
This file is needed by PHP itself.

MSVC?110.dll are included in the Visual Studio 2012 redistributable from
https://www.microsoft.com/en-us/download/details.aspx?id=30679

I could install both of these redistributables on Windows Server 2016 Technical Preview 5.

The problem seems to be the api-ms-win-…dll files which exist on my Windows 7 development machine, but don’t exist on Windows Server 2016 Technical Preview 5. The DLL files appear to be part of something called “Universal C Runtime in Windows” which can be downloaded from here:
https://support.microsoft.com/en-us/kb/3118401

I couldn’t find any way to get these files to work on Windows Server 2016 TP5. The update mentioned above doesn’t work on this version of the OS. There seems to be no solution.

I wasted many days on this - even tried to install Windows Server 2012 R2 on my dedicated sever, but encountered other problems (I don’t have the driver for the network adapter dedicated server). I am firmly commited to switching to NOSQL. The problem is that I can’t use couchbase on this server, period.

My project is done, it works, etc. I just can’t deploy it to the world. I am desperate and have been working for days on this.

I would even use something like “Couchbase as a service”, provided the running costs would be reasonable.

Hi @danarm. Let me find this windows distribution and try to rebuild extension on it.

1 Like

Hi @avsej,

Thank you for helping me.

You can find Windows Server 2016 TP5 at
https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-technical-preview

There are 2 installation options. The first option (the default one) installs the server without a GUI - just the command line is present. So, in order to be able to use it properly, you will have to select the second option, the “desktop experience” one.

Hi @danarm It seems like we have to just rebuild extensions on that platform. I’ve opened ticket PCBC-426 to get jenkins build. Meanwhile, you can use these packages I’ve build on my environment

php_couchbase-2.2.2-7.0-nts-vc14-x64.zip
php_couchbase-2.2.2-7.0-nts-vc14-x86.zip
php_couchbase-2.2.2-7.0-zts-vc14-x64.zip
php_couchbase-2.2.2-7.0-zts-vc14-x86.zip

1 Like

Hello @avsej,

Thank you very much. I will try out the new extensions.