skip to Main Content

I have a Dockerfile relying on PHP:8.1-apache, running since months.

Once PHP:8.1-apache started to use Debian bookworm, the memcached client started to give an error while building the image.

The Dockerfile rows involved are

FROM php:8.1-apache

...

RUN apt-get update --fix-missing -q 
    && apt-get install -y curl mcrypt gnupg build-essential software-properties-common wget vim zip unzip libxml2-dev libz-dev libpng-dev libmemcached-dev 
    && pecl install memcached 
    && docker-php-ext-enable memcached 

...

The error at image build time is:

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
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

Pinning the oldstable version solves the problem,

FROM php:8.1-apache-bullseye

And that clearly indicates that the issue is caused by the switch to new Debian Version.

What could be done to use bookworm and continue to use the same libraries and process ?

2

Answers


  1. Add this two missing libraries in the Dockerfile:

    RUN apt-get install -y libmemcached-dev libmemcached11
    
    Login or Signup to reply.
  2. You’ll probably have to open a ticket with docker to get the image corrected?

    Also a similiar question here:https://serverfault.com/questions/1134001/memcached-support-requires-libmemcached

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search