Hi all-- we definitely are working on PHP 7. We appreciate your interest and understanding that doing this update isnât as simple as weâd like it to be.
On the one hand, we are working on adding a number of features for the upcoming 4.5 release of Couchbase Server. You have probably seen a couple of posts about this. It has new features like Full Text Search and Sub-Document support.
On the other hand, we put some time and effort into PHP 7 shortly after it came out. Where the initial porting looked straightforward, there were more corner cases and unexpected problems that didnât come out until runtime. Some of those changes make it most efficient to, unfortunately, maintain two different branches of the extension. Software porting can sometimes be like this when the platform changes under you. Itâs very hard to estimate and while you really want to get it done, you have a lot to get done and canât just stop everything for that new platform port.
Work has gone into PHP since I posted on Jan 11. Though Iâve not replied here in the last few weeks, it wasnât because of lack of work from the team.
If youâd like to help push things along faster, there are a couple of things you can do. One is that you can jump into the branch and help with the porting/testing. It is, after all Open Source under an Apache 2.0 license. Second, is that if youâre an Enterprise subscriber, let your support/account team know so we can get information on the OS Platform and versions, timelines and further prioritize where we put our testing effort.
Hey Guys,
The php7 branch of our code-base will now compile and has been confirmed to correctly execute most operations. Please feel free to take a look, any help with testing is sincerely appreciated.
Cheers, Brett
Note there was more work done in the last few days here. Itâs not merged yet, but itâs up on our code review system. You can pull it from there if youâd like to let us know how it works out for you.
Hello,
Iâve cloned github repo and tested a simple get/set script, a part of our codebase that uses a counter() and the transcoders.php example.
transcoders.php worked perfectly.
The get/set was basically this:
$cb = new CouchbaseCluster('127.0.0.1:8091');
$bucket = $cb->openBucket('clients');
$r = $bucket->upsert('cb-test-1', 'test-1');
$rr = $bucket->get('cb-test-1');
var_dump($rr);
Hereâs what I got:
2 Warnings on the line with upsert(), both were "Warning: Invalid callback , no array or string given in Unknown on line 0"
1 Warning on the line with get(), "Warning: Invalid callback , no array or string given in Unknown on line 0"
The upsert created an empty document with "att_reason": "invalid_json"
in the meta.
I tried passing an object and array to to upsert, same result. The only thing that worked was a json string, which did not get decoded by get(), but did save correctly.
I also managed to get rid of the warnings by copying the transcoder related code from the transcoders example.
The counter() code did not work at all. The relevant code is $bucket->counter($resource, 1, ['initial' =>1])
, it failed with an exception âThe key does not exist on the serverâ, no document created.
The tests were run on an ubuntu 14.04 vagrant image with cb server version 4.5.0-1308 Enterprise Edition (build-1308)
.
I tried using the repo @ingenthr specified, but ./configure gives configure: WARNING: unrecognized options: --enable-couchbase
and make fails.
Is the latest patchset 6 functional?
http://review.couchbase.org/#/c/62147/6
Looks like the FOREACH_OPCOOKIE_RES macro which was introduced into opcookie.h between patchset 3 and patchset 4 relies on C99, which (at least for me) is not being set as part of the configure / make process:
php-couchbase/opcookie.h:26:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (Type *Res = NULL; \
^
php-couchbase/bucket.c:125:9: note: in expansion of macro 'FOREACH_OPCOOKIE_RES'
FOREACH_OPCOOKIE_RES(opcookie_get_res, res, cookie) {
^
php-couchbase/opcookie.h:26:5: note: use option -std=c99 or -std=gnu99 to compile your code
for (Type *Res = NULL; \
^
Hey @gmot,
Patchset 6 is functional on Mac OS 10.11. I am working on getting my builders working for Windows/Ubuntu/CentOS at the moment. Once these are online, any minor fixes needed for cross-platform compat (such as c99 to c89 fixes) will be done. Sorry for the inconvenience. I hope to have this sorted later today.
Cheers, Brett
Hey @gmot,
Just trying to reproduce that issue you ran into. Any chance you could identify the exact platform you are on, as well as the PHP version you are using?
Cheers, Brett
Hi @brett19
This is Ubuntu 14.0.4, with PHP 7.0.5-2+deb.sury.org~trusty+1
Steps run:
-
Install libcouchbase from Couchbase repoâs via apt
-
Install php7.0 / php7.0-dev via apt, from repo as recommended here:
https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04 -
Clone the master php-couchbase repo, then fetch patchset 6 from gerrit
git clone https://github.com/couchbase/php-couchbase.git
git fetch http://review.couchbase.org/php-couchbase refs/changes/47/62147/6 && git checkout FETCH_HEAD -
Configure and build
./configure --with-couchbase
make
This led to the error mentioned above.
After this, I fired up a clean Ubuntu 14.0 virtual machine, installed php5, cloned the php-couchbase repo, checked out the v2.1.0 tag, configured and built. This was a sanity check to make sure I could build the current GA release with the older php5, and this worked successfully.
Hi @brett19,
I pulled the new patch 8, and can confirm this does indeed build for me with php7.0 under Ubuntu 14.0.
Iâve done some basic gets/sets with Couchbase and at least that much is working well for me.
Thanks for looking into this, and I look forward to seeing it merged into master and published into an official release in the future.
Once you have a times cale for that in place, please do drop back to the forums and let us know, it would be appreciated.
On Archlinux PHP 7.0.5
With master from github and last commit id 48cd3264b0776129f49e72853cd1df532fbdd82f
I canât compile :
/bin/sh /usr/local/src/php-couchbase/libtool --mode=compile cc -I. -I/usr/local/src/php-couchbase -DPHP_ATOM_INC -I/usr/local/src/php-couchbase/include -I/usr/local/src/php-couchbase/main -I/usr/local/src/php-couchbase -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 -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/php-couchbase/bucket.c -o bucket.lo
cc -I. -I/usr/local/src/php-couchbase -DPHP_ATOM_INC -I/usr/local/src/php-couchbase/include -I/usr/local/src/php-couchbase/main -I/usr/local/src/php-couchbase -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 -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/php-couchbase/bucket.c -fPIC -DPIC -o .libs/bucket.o
In file included from /usr/local/src/php-couchbase/bucket.c:5:0:
/usr/local/src/php-couchbase/paramparser.h: Dans la fonction âpcbc_pp_beginâ:
/usr/local/src/php-couchbase/paramparser.h:37:52: attention : passing argument 2 of â_zend_get_parameters_array_exâ from incompatible pointer type [-Wincompatible-pointer-types]
if (_zend_get_parameters_array_ex(param_count, args TSRMLS_CC) != SUCCESS) {
^
In file included from /usr/include/php/main/php.h:39:0,
from /usr/local/src/php-couchbase/couchbase.h:11,
from /usr/local/src/php-couchbase/bucket.c:1:
/usr/include/php/Zend/zend_API.h:250:14: note : expected âzval * {alias struct _zval_struct *}â but argument is of type âzval *** {alias struct _zval_struct ***}â
ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array);
^
In file included from /usr/local/src/php-couchbase/bucket.c:5:0:
/usr/local/src/php-couchbase/paramparser.h:115:43: attention : passing argument 2 of âzend_hash_findâ from incompatible pointer type [-Wincompatible-pointer-types]
if (zend_hash_find(htoptions, arg->name, strlen(arg->name)+1,
etcâŚ
Hey,
I tried testing it again and everything Iâve tested worked.
My setup was similar to @gmotâs except I pulled a newer ref.
git clone https://github.com/couchbase/php-couchbase.git
git fetch http://review.couchbase.org/php-couchbase refs/heads/master
git checkout FETCH_HEAD
phpize7.0
./configure --with-couchbase --with-config=/usr/bin/php-config7.0
make
make install
The configure script had a warning configure: WARNING: unrecognized options: --with-config
, but it worked.
I had to manually set up the ini file, I donât know if the makefile was supposed to that for me or not.
These are the tests that I ran. Everything worked ok.
My PHP version was PHP 7.0.5-2+deb.sury.org~trusty+1 (cli) ( NTS )
, running on a ubuntu VM.
I also ran our platform on it and everything seemed to work just fine.
Iâd like to try it out on one of our test servers next week, if you consider the lib ready.
Finally !
Thank you !
sudo pecl install couchbase-2.2.0beta2
Sorry Any Idea when this is going to be available for window platform?
I see that there is beta3 now and some people are actually using it. Is there ETA at this point? I feel like the new version is going to be released with 4.5 EE as 4.5 features are being added to the SDK.
We plan to release 2.2.0 as GA on 20th of June
Hello,
Thank you for the ETA!
Are there any known issues with the latest beta version?
Are there any known issues left? I saw it was not released at the 20th of June âŚ
I have to shift release a bit. It will be ready by the end of this week