+ -
当前位置:首页 → 问答吧 → 无法加载缓存类型:Memcache

无法加载缓存类型:Memcache

时间:2010-02-25

来源:互联网

在没有TP的时候,测试了官方案例,可以使用Memcache,我配置了TP缓存方式为Memcache,运行就出现下面这样的错误,不知道是哪里的问题?遇到过这个问题的朋友可以告诉我一下吗?

系统发生错误 您可以选择 [ 重试 ] [ 返回 ] 或者 [ 回到首页 ]
[ 错误信息 ]
无法加载缓存类型:Memcache
[ TRACE ]
[10-02-25 22:46:02] () Cache->connect()
[10-02-25 22:46:02] D:\dcj\fs\ThinkPHP\Common\functions.php (251) call_user_func_array(Array, Array)
[10-02-25 22:46:02] D:\dcj\fs\ThinkPHP\Lib\Think\Util\Cache.class.php (145) get_instance_of(Cache, connect, Array)
[10-02-25 22:46:02] D:\dcj\fs\ThinkPHP\Common\functions.php (624) Cache::getInstance()
[10-02-25 22:46:02] D:\dcj\fs\web\Lib\Action\BaseAction.class.php (12) S(cfglist)
[10-02-25 22:46:02] D:\dcj\fs\ThinkPHP\Lib\Think\Core\Action.class.php (45) BaseAction->_initialize()
[10-02-25 22:46:02] D:\dcj\fs\ThinkPHP\Common\functions.php (517) Action->__construct()
[10-02-25 22:46:02] D:\dcj\fs\ThinkPHP\Lib\Think\Core\App.class.php (383) A(Web.Index)
[10-02-25 22:46:02] D:\dcj\fs\ThinkPHP\Lib\Think\Core\App.class.php (439) App::exec()
[10-02-25 22:46:02] D:\dcj\fs\index.php (14) App::run()

作者: shrek82   发布时间: 2010-02-25

我也遇到同样的问题,怎么没人回答呢?楼主解决了吗?

作者: xiaofan   发布时间: 2010-06-24

我也是这样
$Cache = Cache::getInstance('Memcache');  这样不行
$Cache = new Memcache;
$Cache->connect('127.0.0.1', 11211);这样就可以!

作者: luyi0018   发布时间: 2010-08-25

我找到原因了!
Cache 文件没有放到框架里!

作者: luyi0018   发布时间: 2010-08-25

标准版的ThinkPHP包里没有 CacheMemcache.class.php 这个文件。

大家可以在svn里下载他,并放到ThinkPHP\Lib\Think\Util\Cache  下面就可以了。

http://code.google.com/p/thinkph ... he.class.php?r=1887

作者: zg820   发布时间: 2011-05-14