简体   繁体   中英

Can't install memcached package in PHP5.6-apache container

I'm trying to get mamcache working. Using example from https://hub.docker.com/_/php/ (PECL extensions).

My dockerfile simple does next:

 FROM php:5.6-apache

 RUN apt-get update && apt-get install -y libmemcached-dev \
 && pecl install memcached \ 
 && docker-php-ext-enable memcached

But finally I got next:

checking for zlib location... configure: error: memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located
ERROR: `/tmp/pear/temp/memcached/configure --with-php-config=/usr/local/bin/php-config --with-libmemcached-dir=no' failed
error: /usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcached does not exist

usage: /usr/local/bin/docker-php-ext-enable [options] module-name [module-name ...]
   ie: /usr/local/bin/docker-php-ext-enable gd mysqli
       /usr/local/bin/docker-php-ext-enable pdo pdo_mysql
       /usr/local/bin/docker-php-ext-enable --ini-name 0-apc.ini apcu apc

Possible values for module-name:
opcache.so

What do I do wrong ?

You need to install zlib development package. Add zlib1g-dev (not 100% sure for the package name — comment if it doesn't work) to the apt-get install command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM