我想在我的应用程序中使用memcache。 我在php.ini文件中启用了php_memcache.dll,正常的 memcache在简单的PHP strong>中工作正常。 p>
但我不喜欢 当我试图将错误显示为: p>
请帮我解决我的问题。 p>
div>
$ memcache = new Memcache;
$ memcache-> connect('localhost',11211);
$ test = $ memcache-> get(“A”);
if(空($ test)){
echo“设置缓存”; \ n $ memcache-> set(“A”,“缓存内容”,MEMCACHE_COMPRESSED,50);
}
echo $ test;
code> pre>
致命错误时,我不知道如何在 Zend Framework 2 strong>中为常规Memcache创建Memcache对象 未找到类'Application \ Controller \ Memcache'
code> pre>
I want to use memcache into my application. I have enabled php_memcache.dll in php.ini file and normal memcache is working fine in simple PHP.
$memcache = new Memcache;
$memcache->connect('localhost', 11211);
$test = $memcache->get("A");
if(empty($test)){
echo "setting cache";
$memcache->set("A","Cache contents",MEMCACHE_COMPRESSED,50);
}
echo $test;
But I don't know how to create object for Memcache in Zend Framework 2 for normal Memcache, when I am trying to shows error as:
Fatal error: Class 'Application\Controller\Memcache' not found
Please help me to solve my problem.