无法在PHP5.6-apache容器中安装memcached包

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 ?

1个回答



您需要安装 zlib </ code>开发包。 将 zlib1g-dev </ code>(不是100%确定包名称 - 如果它不起作用的注释)添加到 apt-get install </ code>命令。</ p>
</ DIV>

展开原文

原文

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.

duanci1939
duanci1939 是的,你是对的“apt-get install zlib1g-dev”解决了我的问题。 像往常一样,我很接近,但还不够=)非常感谢亚历山大=)
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐