Topic: Is it possible to rebuild pecl-memcached against latest libmemcached

Hello smile

Is it possible to provide us with updated version of `php72-php-pecl-memcached-3.0.4-2.el7.remi.x86_64` which is being rebuild against the latest version of `libmemecahed` v1.0.18?

My question is triggered because I've stumble upon the following issue:

warning: memcached::touch(): using touch command with binary protocol is not recommended with libmemcached versions below 1.0.18, please use ascii protocol or upgrade libmemcached"

The issue is triggered using:

 - CentOS Linux release 7.5.1804
 - php72-php-pecl-memcached-3.0.4-2.el7.remi.x86_64
 - php72-php-pecl-igbinary-2.0.8-1.el7.remi.x86_64
 - Memcached Server v1.5.11 (also tested with older v1.4.39)

I've manage to tackle the problem installing an updated libmemcached from this external repo 'dl.marmotte.net/rpms/redhat/el7/x86_64/libmemcached-1.0.18-6.el7/" and then recompile the memcached.so against the new library using:

yum install zlib-devel.x86_64 cyrus-sasl-devel php72-php-pecl-igbinary-devel
curl dl.marmotte.net/rpms/redhat/el7/x86_64/libmemcached-1.0.18-6.el7/libmemcached-devel-1.0.18-6.el7.x86_64.rpm -o libmemcached-devel-1.0.18-6.el7.x86_64.rpm
rpm -i libmemcached-devel-1.0.18-6.el7.x86_64.rpm
curl pecl.php.net/get/memcached-3.0.4.tgz -o memcached-3.0.4.tgz
tar xzvf memcached-3.0.4.tgz
cd memcached-3.0.4
phpize
./configure --enable-memcached-igbinary
make
make test
mv /opt/remi/php72/root/usr/lib64/php/modules/memcached.so /opt/remi/php72/root/usr/lib64/php/modules/memcached.so_default
cp ./modules/memcached.so /opt/remi/php72/root/usr/lib64/php/modules/memcached.so

So I understand clearly that the problem is caused because the Centos 7 is providing an outdated version of libmemcached (v1.0.16 to be more precise). My intention to start this discussion is to help someone that is experiencing the same issue + to help improve the quality of the repo with the following proposal:
- consider adding libmemcached v1.0.18 as part of the Remi repo
- consider rebuild php72-php-pecl-memcached-3.0.4-2.el7.remi.x86_64 against the latest libmemcached and if possible do the rebuild for the rest of supported PHP versions
- I know how much work will cost such change and I want to be clear that this is only a proposal for discussion and it is not a request,plea,insistence or any other form of ungrateful wish.
- Please excuse me if there is already a solution for this issue, because I'm still unable to find such (here in the forum or in the open net).

Thanks in advance smile

PS - If needed any further information, I will be more then happy to provide it.

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

I usually try to not override package in base repository, and thus provides  newer version as parallel installation (libzip5, ImageMagick6, gd-last, ...)

But libmemcached 1.0.16 and 1.0.18 have the same soname, so this is clearly not easy.

Another side... libmemcached is a dead project... quite strange to rely on it.
But the memcache extension seems dead....

Acceding a memcached server from PHP start to be a challenge.

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

> please use ascii protocol or upgrade libmemcached

Have ytou tried to switch to ascii protocol ?

(btw, this option should be the default, using the provided configuration)

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

Remi wrote:

But the memcache extension seems dead....

Acceding a memcached server from PHP start to be a challenge.

Hello Remi

Thanks for your reply. Just want to point you out that I'm using memecached PHP extension (https://pecl.php.net/package/memcached), and not the old deprecated one memcache. Nevertheless both of them probably relay on the same library.


Remi wrote:

Have ytou tried to switch to ascii protocol ?

(btw, this option should be the default, using the provided configuration)

No, the application need explicitly to use a binary protocol for writing to memcached server. So in my case, switching is not possible solution.


I was thinking that, the actual library does not need to be present/installed in order for the PHP module to work properly. It just need to be compiled with the latest version. So probably providing only a package with '-devel' suffix could do the trick?

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

> Nevertheless both of them probably relay on the same library.

No, only memcached extension use libmemcached.




Can you please give a try to php72-php-pecl-memcached-3.0.4-8.el7 (in remi-test)

This should pull (and use) libmemcached-opt-libs (from remi-safe repository) which is installed in /opt/libmemcached, to avoid conflicts with default system library.


yum --enablerepo=remi-test update php72-php-pecl-memcached
Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

# ldd /opt/remi/php72/root/usr/lib64/php/modules/memcached.so
    libmemcachedprotocol.so.0 => /opt/libmemcached/lib64/libmemcachedprotocol.so.0 (0x00007f2dfdbd0000)
    libmemcached.so.11 => /opt/libmemcached/lib64/libmemcached.so.11 (0x00007f2dfd788000)
    libmemcachedutil.so.2 => /opt/libmemcached/lib64/libmemcachedutil.so.2 (0x00007f2dfd583000)
    ...

# php72 --ri memcached

memcached

memcached support => enabled
Version => 3.0.4
libmemcached version => 1.0.18
SASL support => yes
Session support => yes
igbinary support => yes
json support => yes
msgpack support => yes

Directive => Local Value => Master Value
memcached.sess_binary_protocol => 1 => 1
...
Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

Remi wrote:

> Nevertheless both of them probably relay on the same library.

No, only memcached extension use libmemcached.

My mistake, you are correct on this.


Remi wrote:

Can you please give a try to php72-php-pecl-memcached-3.0.4-8.el7 (in remi-test)

yum --enablerepo=remi-test update php72-php-pecl-memcached

Yes, I did it already, more then once just to be sure. It's working perfectly. No more warning reported, when using touch() with binary protocol.

Thank you very much Remi for the provided support, your work is outstanding (bow). Please write back if I can help you with anything more on this issue.

I have one last question. I didn't able to find information regarding the release cycle, so that is why I'm asking here. I'm curious when I will be able to find the new package from repi-test to be present in main repo 'remi'? Although, I don't want to leave a wrong feeling on this one, because the solution provided by you suits me more then perfect. Just vary curious smile

Thanks one more time for your great work, it's appreciated greatly (bow).

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

> I'm curious when I will be able to find the new package from repi-test to be present in main repo 'remi'?

Soon wink

I was waiting for your feedback about this issue.

So thanks for your feedback.

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

Moved to stable, and for all versions (7.0, 7.1, 7.2 and 7.3) and both base and SCL packages.

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Is it possible to rebuild pecl-memcached against latest libmemcached

Remi wrote:

Moved to stable, and for all versions (7.0, 7.1, 7.2 and 7.3) and both base and SCL packages.

Thanks. I've tested from the main/stable repo of 7.2, it is working flawlessly. Thanks for your help and support (bow).