默认值memcached.serializer =" php"似乎不可能被覆盖。 扩展名igbinary在那里可用,但我不能将值设置为
memcached.serializer="igbinary"
我需要能够拥有"穷人的HA"
它是一个基于标准php的容器:5.6.31-apache。
好吧,似乎我必须在memcached之前部署igbinary扩展(因为它需要访问igbinary headers ....就像https://github.com/php-memcached-dev/php-memcached)。我试过了:
FROM php:5.6.36-apache
RUN apt-get update && apt-get install -y \
# pour installer toutes les déps.
libmemcached11 libmemcachedutil2 build-essential \
libmemcached-dev zlib1g-dev libmcrypt-dev libxml2-dev libpng-dev
libicu-dev\
&& pecl install igbinary \
&& docker-php-ext-enable igbinary \
&& pecl install memcached-2.2.0 \
&& docker-php-ext-enable memcached \
&& docker-php-ext-install -j$(nproc) iconv mcrypt\
xmlrpc soap ctype zip gd intl mysqli opcache \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /tmp/pear
RUN echo "\nmemcached.sess_number_of_replicas = 1;" >>
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini && \
echo "memcached.sess_binary = On;" >>
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini && \
echo "memcached.serializer = \"igbinary\";" >>
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini && \
echo "memcached.sess_consistent_hash = On;" >>
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini
但是当我这样做时:
php -i |grep memcached
在容器中,我得到:
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini,
memcached
memcached support => enabled
libmemcached version => 1.0.18
memcached.compression_factor => 1.3 => 1.3
memcached.compression_threshold => 2000 => 2000
memcached.compression_type => fastlz => fastlz
memcached.serializer => php => php
memcached.sess_binary => 1 => 1
感谢。
答案 0 :(得分:0)
最后,我得到了答案
RUN pecl install igbinary \
&& docker-php-ext-enable igbinary && \
mkdir -p /usr/src/php/ext && cd /usr/src/php/ext \
&& curl -fsSL https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz -o memcached.tar.gz \
&& mkdir -p memcached \
&& tar -xf memcached.tar.gz -C memcached --strip-components=1 \
&& rm memcached.tar.gz \
&& cd memcached && phpize \
&& ./configure --enable-memcached-igbinary --disable-memcached-sasl \
&& make \
&& make install \
&& docker-php-ext-enable memcached
摘自https://hub.docker.com/r/basi/php-coreapi/~/dockerfile/
之后,这只是修改的问题
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini
和瞧。