Skip to content

pickle.phar installation of memcached doesn't work anymore as of PHP 8.1.20 and PHP 8.2.7 #541

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
proligde opened this issue Jun 22, 2023 · 3 comments

Comments

@proligde
Copy link

proligde commented Jun 22, 2023

How to reproduce

  • Build your own docker, based on the official php-fpm container image
  • add prerequisite packages like apt-get install libmemcached-dev
  • install phar
  • install memcached like so: pickle.phar install memcached (which currently is memcached-3.2.0)

Expected result (works perfectly fine with PHP 8.1.19 and PHP 8.2.6)
The package gets installed successfully

Actual result
I get the error: #13 2.516 2: checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix where libmemcached headers and library are located

I assume this message points into a wrong direction, though. Even if I specify the location (which has never been necessary), using an options-file, the installation process fails, stating there's no libmemcached.h headerfile in the defined directory, but it actually is.

I checked the changelog of PHP 8.1.20 and found an info "Phar: Fixed bug GH-11099 (Generating phar.php during cross-compile can't be done)." that looked like it might be related, but that's where my knowledge ends :-).

Any help or workaround suggestion is greatly appreciated – Thanks in advance!

@proligde proligde changed the title pickle.phar installation doesn't work anymore as of PHP 8.1.20 and PHP 8.2.7 pickle.phar installation of memcached doesn't work anymore as of PHP 8.1.20 and PHP 8.2.7 Jun 22, 2023
@mlocati
Copy link

mlocati commented Jun 23, 2023

I also have this issue, but I think it's not related to changes in PHP.

I tested this basic script:

apt update -q
apt install -qy libmemcached-dev zlib1g-dev
echo '' | pecl install memcached
docker-php-ext-enable memcached

In both php:8.2.7-cli-bullseye and php:8.2.7-cli-bookworm docker images.

With bullseye (Debian 11) the memcached PHP extension can be build,. with bookworm (Debian 12) I have the error reported above ("memcached support requires libmemcached").

I think that probably the cause of the issue is an upgrade of the libmemcached system library (in bullseye we have v1.0.18-4.2, in bookworm we have v1.1.4-1), and the build system can't detect it.

@AKorezin
Copy link

AKorezin commented Jul 6, 2023

It seems that there's a hidden private dependency for pkgconf.

php-memcached/config.m4

Lines 245 to 247 in 7fefcb7

if ! $PKG_CONFIG --exists libmemcached; then
AC_MSG_ERROR([memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix where libmemcached headers and library are located])
else

--- a/usr/lib/x86_64-linux-gnu/pkgconfig/libmemcached.pc
+++ b/usr/lib/x86_64-linux-gnu/pkgconfig/libmemcached.pc
@@ -1,11 +1,13 @@
 prefix=/usr
-exec_prefix=${prefix}
-libdir=${prefix}/lib/x86_64-linux-gnu
-includedir=${prefix}/include
+exec_prefix=/usr/bin
+libdir=/usr/lib/x86_64-linux-gnu
+includedir=/usr/include
 
 Name: libmemcached
-URL: http://libmemcachd.org/
-Description: libmemcached C/C++ library.
-Version: 1.0.18
-Libs: -L${libdir} -lmemcached -lmemcachedutil
-Cflags: -I${includedir}
+URL: https://awesomized.github.io/libmemcached/
+Description: libmemcached C/C++ library
+Version: 1.1.4
+Libs: -L/usr/lib/x86_64-linux-gnu -lmemcached -lmemcachedutil
+Cflags: -I/usr/include
+Requires:  libsasl2
+Requires.private:  libcrypto
  1. bullseye
    #apt-get install -y libmemcached-dev zlib1g-dev
    #pkgconf --exists libmemcached; echo $?
    0
    
  2. bookworm
    #apt-get install -y libmemcached-dev zlib1g-dev
    #pkgconf --exists --print-errors libmemcached; echo $?
    Package libcrypto was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libcrypto.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'libcrypto', required by 'libmemcached', not found
    1
    
    #apt-get install -y libmemcached-dev zlib1g-dev libssl-dev
    #pkgconf --exists libmemcached; echo $?
    0
    

libssl-dev should be somewhere here
https://salsa.debian.org/debian/libmemcached/-/blob/6e31130745a6be9325dbc6ab3f0697d20ee7ca16/debian/control#L49-54

Refs:

@proligde
Copy link
Author

thank y'all! Works as intended after installing libssl-dev as suggested. Closing issue

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

3 participants