大网数据广告活动
服务器运维问答

memcached support requires libmemcached

· 52CE 我爱测

We've configured a Dockerfile containing the following code snippet: ENV MEMCACHE_VERSION=8.0 \ MEMCACHED_VERSION=3.2.0 ############## END ENVIRONMENT VARIABLES ############### ####################################################…

问题原文

原帖链接 · IT-Girl · CC BY-SA 4.0

We've configured a Dockerfile containing the following code snippet:

ENV MEMCACHE_VERSION=8.0 \
    MEMCACHED_VERSION=3.2.0

############## END ENVIRONMENT VARIABLES ###############
########################################################

RUN apt-get update && apt-get install -y --no-install-recommends \
    zlib1g-dev \
    zlib1g \
    libmemcached11 \
    libmemcachedutil2 \
    libmemcached-dev \
    libmagickwand-dev 

RUN pecl install memcache-$MEMCACHE_VERSION && \
    pecl install memcached-$MEMCACHED_VERSION && \
    pecl install imagick

But yesterday starting from 17:00 after running docker compose up --build -d --force-recreate all of a sudden the following error started occuring. Note: This did not happen before 17:00, the whole day it worked just fine.

 => ERROR [builder 3/3] RUN pecl install memcache-8.0 &&     pecl install memcached-3.2.0 &&     pecl install imagick                   15.1s

#0 15.03 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
#0 15.06 ERROR: `/tmp/pear/temp/memcached/configure --with-php-config=/usr/local/bin/php-config --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz=no --enable-memcached-igbinary=no --enable-memcached-msgpack=no --enable-memcached-json=no --enable-memcached-protocol=no --enable-memcached-sasl=yes --enable-memcached-session=yes' failed
------
failed to solve: process "/bin/sh -c pecl install memcache-$MEMCACHE_VERSION &&     pecl install memcached-$MEMCACHED_VERSION &&     pecl install imagick" did not complete successfully: exit code: 1

I want to repeat that we haven't changed anything in the Dockerfile and this started happening to my other colleagues docker environments as well as if something has changed in the libmemcached or memcached modules since yesterday around this time.

What we've already tried:

  • Using the option behind the commands -with-libmemcached-dir=/usr/include/libmemcached
  • Updating Docker Desktop
  • Install libmemcached manually on the docker container and uncommenting the memcache/memcached/imagick installs code below to see if libmemcached was installer for real. libmemcached was present in the folder /usr/include/libmemcached. Running the memcached installation right after resulted in the same error
  • Freak out and stare at the screen hoping it will go away

社区高分解答

原帖链接 · Wireblue · CC BY-SA 4.0

If you wish to use Debian Bookworm, I got memcached working by installing libssl-dev also.

RUN apt install -y libmemcached-dev zlib1g-dev libssl-dev

Credit to AKorezin: https://github.com/php-memcached-dev/php-memcached/issues/541#issuecomment-1624041385

Then you can follow the usual PECL install process:

RUN yes '' | pecl install -f memcached-3.2.0 \
  && docker-php-ext-enable memcached

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2023-06-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。