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 php 5.6 #575
Comments
It looks like you are missing an |
Thanks, the update-command was actually missing! For others pondering similar issues, I also realized what was the other problem I had: The code above only installs PHP memcached module and not the memcached service. So there was nothing to connect to. I did: "RUN apt-get install -y memcached" and then after the container is running gave the command "service memcached start" and the PHP code started working. I could not figure out the right command in dockerfile to start memcached service in the same container as apache and php though. |
@raphaelcoder to run them together in the same container, you'd need something like runit or supervisor to manage both processes I'd recommend instead running |
I'm trying to run memcached with docker with the following dockerfile
FROM php:5.6-apache
RUN apt-get -y install libz-dev libmemcached-dev libmemcached11 libmemcachedutil2 build-essential
&& pecl install memcached-2.2.0
&& 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
COPY index.php /var/www/html/
And index.php just has a very basic Memcached test from PHP-site:
addServer("localhost", 11211); $mc->set("foo", "Hello!"); $mc->set("bar", "Memcached..."); $arr = array( $mc->get("foo"), $mc->get("bar") ); var_dump($arr); ?>The set command seems to fail. Any ideas what goes wrong? Tried to go into docker container and telnet to 127.0.0.1 and it didnt connect. Says connection refused. Tried also 127.0.0.1 instead of localhost for addServer.
The text was updated successfully, but these errors were encountered: