Skip to content

Cannot enable libmemcached protocol #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
panosru opened this issue Dec 21, 2018 · 13 comments
Closed

Cannot enable libmemcached protocol #418

panosru opened this issue Dec 21, 2018 · 13 comments

Comments

@panosru
Copy link

panosru commented Dec 21, 2018

I have libmemcached-dev installed (latest version) and when I run pecl install memcached

I'm getting:

checking for memcached protocol support... enabled
checking whether libmemcachedprotocol is usable... no
configure: error: Cannot enable libmemcached protocol

With 3.0.4 works fine.

@blkperl
Copy link
Contributor

blkperl commented Dec 21, 2018

Same issue with PHP 7.3 and memcached-3.1.1

@panosru
Copy link
Author

panosru commented Dec 21, 2018

@blkperl I'm on PHP 7.2.13 (docker php-fpm)

@vrobert78
Copy link

Same issue with php:7.2.13-fpm-stretch and memcached-3.1.1.

@hswong3i
Copy link

Also failed with php:7.3-cli and memcached-3.1.1

https://travis-ci.org/alvistack/docker-php/builds/471317394#L8442

hswong3i added a commit to alvistack/docker-php-fpm that referenced this issue Dec 22, 2018
hswong3i added a commit to alvistack/docker-php-fpm that referenced this issue Dec 22, 2018
@sodabrew
Copy link
Contributor

3.1.2 released, please confirm if resolved now!

@panosru
Copy link
Author

panosru commented Dec 22, 2018

@sodabrew just checked and it worked for me (php-fpm 7.2.13/docker)

@blkperl
Copy link
Contributor

blkperl commented Dec 22, 2018

@sodabrew works for me PHP 7.3/Ubuntu Xenial docker.

@panosru
Copy link
Author

panosru commented Dec 22, 2018

Obviously that is working because it passes --enable-memcached-protocol=no, but what if is needed?

@sodabrew
Copy link
Contributor

sodabrew commented Dec 22, 2018

I haven't personally tested server protocol support, and I don't see unit tests for it. I'm not sure what the use case would be for the PHP module. Existence of this code predates my role as maintainer.

The libmemcached library has to be compiled to provide server protocol support, by default (and in most distributions) it is disabled:
https://bazaar.launchpad.net/~tangent-trunk/libmemcached/1.0/view/head:/configure.ac#L81

AC_DEFUN([LIBMEMCACHED_PROTOCOL],
         [AC_ARG_ENABLE([libmemcachedprotocol],
                        [AS_HELP_STRING([--enable-libmemcachedprotocol],
                                        [Enable libmemcachedprotocol])],
                                        [ax_enable_libmemcachedprotocol=yes],
                                        [ax_enable_libmemcachedprotocol=no])

         AM_CONDITIONAL([BUILD_LIBMEMCACHED_PROTOCOL],[test "$ax_enable_libmemcachedprotocol" = "yes"])

         AC_MSG_CHECKING([for libmemcachedprotocol])
         AC_MSG_RESULT([$ax_enable_libmemcachedprotocol])
         ])
LIBMEMCACHED_PROTOCOL

@sodabrew
Copy link
Contributor

(@blkperl Did we meet ages ago at a Puppet meetup? Hi!)

@blkperl
Copy link
Contributor

blkperl commented Dec 22, 2018

@sodabrew Yes! Hi 😄

m6w6 added a commit to m6w6/php-memcached that referenced this issue Jan 19, 2021
@llaville
Copy link

llaville commented May 9, 2021

Hello @sodabrew

I've tried today to install php memcached extension without success under PHP 7.3.28 with latest version 3.1.5 and PECL

[email protected] in ~ $ pecl install --force --alldeps memcached

downloading memcached-3.1.5.tgz ...
Starting to download memcached-3.1.5.tgz (83,015 bytes)
....................done: 83,015 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731
libmemcached directory [no] : yes
zlib directory [no] : yes
use system fastlz [no] : no
enable igbinary serializer [no] : yes
enable msgpack serializer [no] : yes
enable json serializer [no] : yes
enable server protocol [no] : yes
enable sasl [yes] :
enable sessions [yes] :
building in /tmp/pear/temp/pear-build-rootiVH637/memcached-3.1.5
running: /tmp/pear/temp/memcached/configure --with-php-config=/usr/local/bin/php-config --with-libmemcached-dir --with-zlib-dir --with-system-fastlz=no --enable-memcached-igbinary=yes --enable-memcached-msgpack=yes --enable-memcached-json=yes --enable-memcached-protocol=yes --enable-memcached-sasl=yes --enable-memcached-session=yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20180731
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 1.1.1 (ok)
checking for gawk... gawk
checking whether to enable memcached support... yes, shared
checking for libmemcached... yes, shared
checking whether to enable memcached session handler support... yes
checking whether to enable memcached igbinary serializer support... yes
checking whether to enable memcached json serializer support... yes
checking whether to enable memcached msgpack serializer support... yes
checking whether to enable memcached sasl support... yes
checking whether to enable memcached protocol support... yes
checking whether to use system FastLZ library... no
checking for ZLIB... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking for zlib location... /usr
checking for session includes... /usr/local/include/php
checking for json includes... /usr/local/include/php
checking for igbinary includes... /usr/local/include/php
checking for msgpack includes... /usr/local/include/php
checking for memcached session support... enabled
checking for memcached igbinary support... enabled
checking for memcached msgpack support... enabled
checking for libmemcached location... found version 1.0.18, under /usr
checking for libmemcached sasl.h requirement... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sasl/sasl.h usability... yes
checking sasl/sasl.h presence... yes
checking for sasl/sasl.h... yes
checking whether to enable sasl support... yes
checking for sasl_client_init in -lsasl2... yes
checking whether memcached_exist is defined... yes
checking whether memcached_set_encoding_key is defined... yes
checking for memcached protocol support... enabled
checking whether libmemcachedprotocol is usable... no
configure: error: Cannot enable libmemcached protocol
ERROR: `/tmp/pear/temp/memcached/configure --with-php-config=/usr/local/bin/php-config --with-libmemcached-dir --with-zlib-dir --with-system-fastlz=no --enable-memcached-igbinary=yes --enable-memcached-msgpack=yes --enable-memcached-json=yes --enable-memcached-protocol=yes --enable-memcached-sasl=yes --enable-memcached-session=yes' failed

Did I missed something ?

Libmemcached is installed (version 1.0.18) !

[email protected] in ~ $ pkg-config --print-provides --debug libmemcached
Error printing enabled by default due to use of output options besides --exists, --atleast/exact/max-version or --list-all. Value of --silence-errors: 0
Error printing enabled
Adding virtual 'pkg-config' package to list of known packages
Cannot open directory #1 '/usr/local/lib/x86_64-linux-gnu/pkgconfig' in package search path: No such file or directory
Scanning directory #2 '/usr/local/lib/pkgconfig'
File 'vips.pc' appears to be a .pc file
Will find package 'vips' in file '/usr/local/lib/pkgconfig/vips.pc'
Ignoring file '..' in search directory; not a .pc file
File 'vips-cpp.pc' appears to be a .pc file
Will find package 'vips-cpp' in file '/usr/local/lib/pkgconfig/vips-cpp.pc'
Ignoring file '.' in search directory; not a .pc file
Cannot open directory #3 '/usr/local/share/pkgconfig' in package search path: No such file or directory
Scanning directory #4 '/usr/lib/x86_64-linux-gnu/pkgconfig'
File 'icu-i18n.pc' appears to be a .pc file
Will find package 'icu-i18n' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/icu-i18n.pc'
File 'libidn2.pc' appears to be a .pc file
Will find package 'libidn2' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libidn2.pc'
File 'libbrotlidec.pc' appears to be a .pc file
Will find package 'libbrotlidec' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libbrotlidec.pc'
File 'icu-uc.pc' appears to be a .pc file
Will find package 'icu-uc' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/icu-uc.pc'
File 'libwebp.pc' appears to be a .pc file
Will find package 'libwebp' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libwebp.pc'
File 'libbrotlicommon.pc' appears to be a .pc file
Will find package 'libbrotlicommon' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libbrotlicommon.pc'
File 'libcurl.pc' appears to be a .pc file
Will find package 'libcurl' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libcurl.pc'
File 'libevent_core.pc' appears to be a .pc file
Will find package 'libevent_core' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libevent_core.pc'
File 'libbrotlienc.pc' appears to be a .pc file
Will find package 'libbrotlienc' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libbrotlienc.pc'
File 'icu-io.pc' appears to be a .pc file
Will find package 'icu-io' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/icu-io.pc'
File 'libevent_openssl.pc' appears to be a .pc file
Will find package 'libevent_openssl' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libevent_openssl.pc'
File 'libwebpmux.pc' appears to be a .pc file
Will find package 'libwebpmux' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libwebpmux.pc'
File 'libwebpdemux.pc' appears to be a .pc file
Will find package 'libwebpdemux' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libwebpdemux.pc'
File 'libevent_extra.pc' appears to be a .pc file
Will find package 'libevent_extra' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libevent_extra.pc'
File 'libidn.pc' appears to be a .pc file
Will find package 'libidn' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libidn.pc'
File 'libevent.pc' appears to be a .pc file
Will find package 'libevent' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libevent.pc'
File 'libevent_pthreads.pc' appears to be a .pc file
Will find package 'libevent_pthreads' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libevent_pthreads.pc'
Ignoring file '..' in search directory; not a .pc file
Ignoring file '.' in search directory; not a .pc file
File 'libmemcached.pc' appears to be a .pc file
Will find package 'libmemcached' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libmemcached.pc'
File 'libsasl2.pc' appears to be a .pc file
Will find package 'libsasl2' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libsasl2.pc'
File 'python-2.7.pc' appears to be a .pc file
Will find package 'python-2.7' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/python-2.7.pc'
File 'expat.pc' appears to be a .pc file
Will find package 'expat' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/expat.pc'
File 'ruby-2.5.pc' appears to be a .pc file
Will find package 'ruby-2.5' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/ruby-2.5.pc'
File 'libssl.pc' appears to be a .pc file
Will find package 'libssl' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libssl.pc'
File 'ruby.pc' appears to be a .pc file
Will find package 'ruby' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/ruby.pc'
File 'libcrypto.pc' appears to be a .pc file
Will find package 'libcrypto' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libcrypto.pc'
File 'openssl.pc' appears to be a .pc file
Will find package 'openssl' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc'
File 'zlib.pc' appears to be a .pc file
Will find package 'zlib' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc'
File 'libffi.pc' appears to be a .pc file
Will find package 'libffi' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/libffi.pc'
File 'yaml-0.1.pc' appears to be a .pc file
Will find package 'yaml-0.1' in file '/usr/lib/x86_64-linux-gnu/pkgconfig/yaml-0.1.pc'
Scanning directory #5 '/usr/lib/pkgconfig'
Ignoring file '..' in search directory; not a .pc file
Ignoring file '.' in search directory; not a .pc file
Scanning directory #6 '/usr/share/pkgconfig'
Ignoring file '..' in search directory; not a .pc file
Ignoring file '.' in search directory; not a .pc file
File 'bash-completion.pc' appears to be a .pc file
Will find package 'bash-completion' in file '/usr/share/pkgconfig/bash-completion.pc'
File 'poppler-data.pc' appears to be a .pc file
Will find package 'poppler-data' in file '/usr/share/pkgconfig/poppler-data.pc'
File 'shared-mime-info.pc' appears to be a .pc file
Will find package 'shared-mime-info' in file '/usr/share/pkgconfig/shared-mime-info.pc'
Looking for package 'libmemcached'
Looking for package 'libmemcached-uninstalled'
Reading 'libmemcached' from file '/usr/lib/x86_64-linux-gnu/pkgconfig/libmemcached.pc'
Parsing package file '/usr/lib/x86_64-linux-gnu/pkgconfig/libmemcached.pc'
  line>prefix=/usr
 Variable declaration, 'prefix' has value '/usr'
  line>exec_prefix=${prefix}
 Variable declaration, 'exec_prefix' has value '/usr'
  line>libdir=${prefix}/lib/x86_64-linux-gnu
 Variable declaration, 'libdir' has value '/usr/lib/x86_64-linux-gnu'
  line>includedir=${prefix}/include
 Variable declaration, 'includedir' has value '/usr/include'
  line>
  line>Name: libmemcached
  line>URL: http://libmemcachd.org/
  line>Description: libmemcached C/C++ library.
  line>Version: 1.0.18
  line>Libs: -L${libdir} -lmemcached -lmemcachedutil
  line>Cflags: -I${includedir}
Path position of 'libmemcached' is 4
Adding 'libmemcached' to list of known packages
Package libmemcached has -I/usr/include in Cflags
Removing -I/usr/include from cflags for libmemcached
Package libmemcached has -L /usr/lib/x86_64-linux-gnu in Libs
Removing -L /usr/lib/x86_64-linux-gnu from libs for libmemcached
libmemcached = 1.0.18

@m6w6
Copy link
Contributor

m6w6 commented May 18, 2021

@llaville configure checks for the presence of ${INCLUDES}/libmemcachedprotocol-0.0/handler.h

But mind you:

HTH

m6w6 added a commit to m6w6/php-memcached that referenced this issue Jul 23, 2021
mszabo-wikia added a commit to mszabo-wikia/php-memcached that referenced this issue Sep 27, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] php-memcached-dev#418 (comment)
mszabo-wikia added a commit to mszabo-wikia/php-memcached that referenced this issue Sep 27, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] php-memcached-dev#418 (comment)
mszabo-wikia added a commit to mszabo-wikia/php-memcached that referenced this issue Sep 27, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] php-memcached-dev#418 (comment)
mszabo-wikia added a commit to mszabo-wikia/php-memcached that referenced this issue Sep 27, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] php-memcached-dev#418 (comment)
mszabo-wikia added a commit to mszabo-wikia/php-memcached that referenced this issue Sep 27, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] php-memcached-dev#418 (comment)
mszabo-wikia added a commit to mszabo-wikia/php-memcached that referenced this issue Sep 27, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] php-memcached-dev#418 (comment)
mszabo-wikia added a commit to mszabo-wikia/php-memcached that referenced this issue Sep 27, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] php-memcached-dev#418 (comment)
sodabrew pushed a commit that referenced this issue Nov 8, 2021
travis-ci.org builds have ceased, so this patch adds a GitHub Actions
workflow to build and test the extension, as well as a Dependabot
configuration file to keep the referenced actions up to date.

I've opted to slightly simplify the workflow compared to the Travis
build script. For one, I have not included libmemcached protocol
support, as most distros do not supply a libmemcached compiled with
server protocol support, and previous discussion suggests its usefulness
in the context of this extension may be limited.[1] I've also opted to
remove multiversion libmemcached testing in favor of using the system
libmemcached, as the referenced other versions seem to be old enough for
this to hopefully not be a problem. These could conceivably be
reintroduced if needed.

---
[1] #418 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants