简体   繁体   English

Memcached无法在php中工作

[英]Memcached not working in php

I can't make memcache work. 我无法使Memcache工作。 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. 我正确安装了它,并检查了phpinfo并在那找到了它。 why can't I make it work? 我为什么不能使它工作?

UPDATE: 更新:

I'm using virtualbox.. and debian is my guest os. 我正在使用virtualbox ..,而debian是我的来宾操作系统。 and everything is working in php it's just that i can't make it work for memcached 一切都在PHP中工作,只是我无法使其适用于memcached

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

memcached -vv -m64 -l127.0.0.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM