Missing --enable-couchbase


#1

Can’t compile the .dll on Windows.
In configure --help there’s only --with-couchbase
So running configure --disable-all --enable-cli --enable-couchbase gives errorUnknown option. And running with--with-couchbase doesn’t compile the .dll

PHP 5.6.20 x86 VC11


#2

You only need --with-couchbase


#3

So where is the .dll located?


#4

@rhazorzor, by default it configures static build, which is shown right after the configure --disable-all --enable-cli --with-couchbase:

...
Enabled extensions:
-----------------------
| Extension  | Mode   |
-----------------------
| couchbase  | static |
| date       | static |
| ereg       | static |
| pcre       | static |
| reflection | static |
| spl        | static |
| standard   | static |
-----------------------
...

So your couchbase extension is already compiled into php binary.

If you want to create shared object (DLL), you have to tell it explicitly during configuration phase:

configure --disable-all --enable-cli --with-couchbase=shared

So if you are using official step by step guide to setup build environment, couchbase libraries should be stored here after successful build:

C:\php-sdk\phpdev\vc11\x86\php-5.6.20-src\Release_TS\php_couchbase.dll
C:\php-sdk\phpdev\vc11\x86\php-5.6.20-src\Release_TS\php_couchbase.dll.manifest
C:\php-sdk\phpdev\vc11\x86\php-5.6.20-src\Release_TS\php_couchbase.dll.res
C:\php-sdk\phpdev\vc11\x86\php-5.6.20-src\Release_TS\php_couchbase.exp
C:\php-sdk\phpdev\vc11\x86\php-5.6.20-src\Release_TS\php_couchbase.lib

#5

I did that, but I don’t get the .dll’s in the Release_TS\ dir (I even used search for .dll) What I’m missing?


#6

There is no any couchbase row in extensions table, Do you see a WARNING there? you have to download and unpack into deps directory libcouchbase package http://developer.couchbase.com/documentation/server/4.0/sdks/c-2.4/download-list.html


#7

I downloaded the Visual Studio 12 x86 version.
There is deps/ dir only in x86/ dir , so I put it there and configure doesn’t find it. It gives me Unknown option --with-couchbase.


#8

are you sure you unpacked it correctly? the contents of archive matches layout of deps, I mean bin directory goes to deps/bin and so on


#9


#10

after placing libcouchbase, you have to regenerate configure script, your old one disabled it

buildconf

#11

I did, the screenshot is after everything.


#12

is the extension still on the place in pecl/php-couchbase?


#13

Okay, but it didn’t create THE php_couchbase.dll


#14

any warnings/errors in the output?


#15
Recreating build dirs
Recreating build dirs
Recreating build dirs
Recreating build dirs
couchbase.c
apidecl.c
arithmetic.c
..\pecl\couchbase\arithmetic.c(74) : warning C4244: '=' : conversion from 'uint64_t' to 'long', possible loss of data
ccache.c
compress.c
convert.c
..\pecl\couchbase\convert.c(91) : warning C4018: '<' : signed/unsigned mismatch
create.c
designdoc.c
error.c
exceptions.c
flush.c
..\pecl\couchbase\flush.c(40) : warning C4013: 'assert' undefined; assuming extern returning int
..\pecl\couchbase\flush.c(150) : warning C4101: 'ctx' : unreferenced local variable
get.c
..\pecl\couchbase\get.c(490) : warning C4244: '=' : conversion from 'long' to 'unsigned char', possible loss of data
ht.c
..\pecl\couchbase\ht.c(53) : warning C4013: 'assert' undefined; assuming extern returning int
misc.c
observe.c
..\pecl\couchbase\observe.c(314) : warning C4244: '=' : conversion from 'long' to 'short', possible loss of data
..\pecl\couchbase\observe.c(317) : warning C4244: '=' : conversion from 'long' to 'short', possible loss of data
options.c
..\pecl\couchbase\options.c(44) : warning C4244: '=' : conversion from 'long' to 'char', possible loss of data
..\pecl\couchbase\options.c(78) : warning C4244: '=' : conversion from 'long' to 'char', possible loss of data
..\pecl\couchbase\options.c(95) : warning C4244: '=' : conversion from 'long' to 'char', possible loss of data
..\pecl\couchbase\options.c(100) : warning C4244: '=' : conversion from 'long' to 'unsigned char', possible loss of data
remove.c
..\pecl\couchbase\remove.c(92) : warning C4244: 'function' : conversion from 'long' to 'uint16_t', possible loss of data
..\pecl\couchbase\remove.c(58) : warning C4101: 'ctx' : unreferenced local variable
resmgr.c
stat.c
simple_observe.c
store.c
timeout.c
touch.c
unlock.c
..\pecl\couchbase\unlock.c(90) : warning C4244: 'function' : conversion from 'long' to 'uint16_t', possible loss of data
version.c
views.c
viewopts.c
..\pecl\couchbase\viewopts.c(85) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
..\pecl\couchbase\viewopts.c(159) : warning C4018: '<' : signed/unsigned mismatch
fastlz.c
buckets.c
..\pecl\couchbase\management\buckets.c(122) : warning C4018: '<' : signed/unsigned mismatch
instance.c
..\pecl\couchbase\management\instance.c(30) : warning C4013: 'assert' undefined; assuming extern returning int
management.c
        1 file(s) copied.
   Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp
        rc /n /fo Release_TS\php_couchbase.dll.res /d FILE_DESCRIPTION="\"The following people contributed (code/help) to the module (in\"" /d FILE_NAME="\"php_couchbase.dll\"" /d URL="\"http://pecl.php.net/couchbase\"" /d INTERNAL_NAME="\"COUCHBASE extension\"" /d THANKS_GUYS="\"Thanks to alphabetical order):\"" win32\build\template.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

        1 file(s) copied.
   Creating library Release_TS\php_couchbase.lib and object Release_TS\php_couchbase.exp
convert.obj : error LNK2019: unresolved external symbol __imp__php_json_encode referenced in function _php_couchbase_zval_to_payload
convert.obj : error LNK2019: unresolved external symbol __imp__php_json_decode_ex referenced in function _php_json_decode
flush.obj : error LNK2019: unresolved external symbol _assert referenced in function _rest_flush_callback
ht.obj : error LNK2001: unresolved external symbol _assert
instance.obj : error LNK2001: unresolved external symbol _assert
Release_TS\php_couchbase.dll : fatal error LNK1120: 3 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.exe"' : return code '0x2'
Stop.

#16

It seems like it fails to pick up json extension. Could you make sure it is also enabled?


#17

php -m shows json is loaded.


#18

OK this time I downloaded teh package from https://pecl.php.net/package/couchbase and now I got:

Recreating build dirs
Recreating build dirs
Recreating build dirs
bucket.c
cas.c
cluster.c
exception.c
metadoc.c
transcoding.c
        1 file(s) copied.
   Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp
bucket.obj : error LNK2019: unresolved external symbol _couchbase_globals_id referenced in function _couchbase_shutdown_bucket
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_get_resource referenced in function _php_couchbase_get_result_message_impl
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_res_ok referenced in function _php_couchbase_get_result_message_impl
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_arithmetic_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_get_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_store_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_remove_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_view_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_observe_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_stat_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_version_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_unlock_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _couchbase_report_error referenced in function _pcbc_check_expiry
couchbase.obj : error LNK2019: unresolved external symbol _cb_illegal_arguments_exception referenced in function _pcbc_check_expiry
Release_TS\php_couchbase.dll : fatal error LNK1120: 14 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.exe"' : return code '0x2'
Stop.

#19

2.1.0? I was checking with master version github. I will check with pecl release and get back here


#20

Yes, Latest Tarball. I’m also browsing and found that couchbase dependency is igbinary. But I also fail compiling that one because it says the igbinary dependency is only PHP 5.2.0 or newer and I get message it’s missing dependencies.

EDIT: OK, I also tested with https://github.com/couchbase/php-couchbase/ .zip file and got same errors?

C:\php-sdk\bin\phpdev\vc11\x86\php-5.6.20>nmake

Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Recreating build dirs
Recreating build dirs
Recreating build dirs
opcookie.c
        1 file(s) copied.
   Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp
bucket.obj : error LNK2019: unresolved external symbol _couchbase_globals_id referenced in function _couchbase_shutdown_bucket
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_get_resource referenced in function _php_couchbase_get_result_message_impl
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_res_ok referenced in function _php_couchbase_get_result_message_impl
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_arithmetic_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_get_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_store_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_remove_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_view_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_observe_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_stat_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_version_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _php_couchbase_callbacks_unlock_init referenced in function _php_couchbase_setup_callbacks
couchbase.obj : error LNK2019: unresolved external symbol _couchbase_report_error referenced in function _pcbc_check_expiry
couchbase.obj : error LNK2019: unresolved external symbol _cb_illegal_arguments_exception referenced in function _pcbc_check_expiry
Release_TS\php_couchbase.dll : fatal error LNK1120: 14 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.exe"' : return code '0x2'
Stop.