-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memcached support #132
Comments
|
Actually, nevermind... I thought you were using You need something like this: FROM php:5.5.29-apache
RUN apt-get update && apt-get install -y libz-dev libmemcached-dev
RUN pecl install memcached |
@md5 thank you that was indeed it with the following modification (for future readers):
|
Thanks @polds. That reminds me that @helderco once mentioned creating a |
The smallest layer for the pecl install is probably the following: RUN apt-get update \
&& apt-get install -y libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \
&& pecl install memcached \
&& echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini \
&& apt-get remove -y build-essential libmemcached-dev libz-dev \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /tmp/pear |
^ That worked as well. |
Thanks @hairmare I was being lazy since I don't tend to be as aggressive with the sizes of "normal" images. I think you'll also want a |
I failed to get memcached to work on PHP7. Finally managed to do so using the following lines, using the php7 branch and building from source:
Is there any better way? |
@roelvanduijnhoven for PHP7 ì'm doing this:
|
Thanks @paolomainardi, looks a lot easier. I realise now how the bundled docker-php-ext.. scripts work. |
@roelvanduijnhoven you're welcome |
Thank you all. I further shortened #132 (comment) a little bit. Now, I am using this config in my image for Drupal https://github.com/INsReady/php-fpm-for-cms/blob/master/7.0/Dockerfile#L11 |
With last version php:7.0-fpm stop working
|
@vitalyzhakov, I think that is related to #266. |
Did anyone manage to fix this problem? I am reading through #266 but have no clue if and how I should solve this.. |
This code works for me under php 7.0.8-fpm
|
Thanks! ❤️ |
This may be obvious, but for someone (like me) it's not. Notice that the above snippet puts the memcached library into So if you want to mount a volume into Something like this works for me: RUN apt-get -y install libmemcached11 libmemcachedutil2 libmemcached-dev \
&& cd /usr/local/share \
&& git clone --branch php7 https://github.com/php-memcached-dev/php-memcached \
&& cd php-memcached \
&& phpize \
&& ./configure \
&& make \
&& echo "extension=/usr/local/share/php-memcached/modules/memcached.so" > /usr/local/etc/php/conf.d/memcached.ini |
Please do it the right way: use the The best practice should look something like this: FROM php:7.0-fpm
RUN apt-get update \
&& buildDeps=" \
git \
libmemcached-dev \
zlib1g-dev \
" \
&& doNotUninstall=" \
libmemcached11 \
libmemcachedutil2 \
" \
&& apt-get install -y $buildDeps --no-install-recommends \
&& rm -r /var/lib/apt/lists/* \
\
&& docker-php-source extract \
&& git clone --branch php7 https://github.com/php-memcached-dev/php-memcached /usr/src/php/ext/memcached/ \
&& docker-php-ext-install memcached \
\
&& docker-php-source delete \
&& apt-mark manual $doNotUninstall \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps This way you use |
@adminblogger nice! Thx! If your favor... Tell me pls... Where can i find runtime dependencies for another extensional?
|
For anyone who finds this because their Dockerfile has begun to fail while trying "pecl install memcached" (with the error "pecl/memcached requires PHP (version >= 7.0.0), installed version is [5.6.something]", on 02/08/17 the pecl memcached package version 3.0 was released, requiring php 7.0 or higher. To continue using memcached with php 5.6.x, update your Dockerfile to use version 2.2.0 of the memcached package:
instead of
The relevant section of my Dockerfile, as a result, is:
|
Wondering if anyone has gotten memcached (not memcache) to work? Trying to build in
php:5.5.29-apache
to get the php memcached module installed. I have tried the following to no avail. Any help is greatly appreciated.Dockerfile 1
Notes:
Dockerfile 2
Notes:
Dockerfile 3
Notes:
The text was updated successfully, but these errors were encountered: