简体   繁体   中英

Memcached not working in php

I can't make memcache work. I followed this tutorial and when I try the example from the last part of the tutorial I don't get any output.

Here's the code from the tutorial.

$m = new Memcached();
$m->addServer('localhost', 11211);
$m->set('key', 'hello world');
var_dump($m->get('key'));

When I load it to my webpage I don't get any output. It says error. What's wrong with my server? I installed it correctly and checked my phpinfo and found it there. why can't I make it work?

UPDATE:

I'm using virtualbox.. and debian is my guest os. and everything is working in php it's just that i can't make it work for memcached

在终端中启动memcached守护程序,如下所示:

memcached -vv -m64 -l127.0.0.1

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