PHP memcached致命错误:找不到类"Memcache" [英] PHP memcached Fatal error: Class 'Memcache' not found

查看:447
本文介绍了PHP memcached致命错误:找不到类"Memcache"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 php.net 粘贴了示例在php中使用memcached的方法,我得到:

I've pasted the example from php.net for using memcached in php and I'm getting:

Fatal error: Class 'Memcache' not found

我的php.ini文件中有这个

I have this in my php.ini:

[内存缓存]
memcache.hash_strategy =一致"
memcache.max_failover_attemps = 100
memcache.allow_failover = 1

[memcache]
memcache.hash_strategy = "consistent"
memcache.max_failover_attemps = 100
memcache.allow_failover = 1

分别来自php -i和php -m的信息:

Here's info from php -i and php -m respectively:

php -i | grep -i memcache
memcached
memcached支持=>已启用
libmemcached版本=> 0.37
注册的保存处理程序=>文件用户sqlite memcached

php -i | grep -i memcache
memcached
memcached support => enabled
libmemcached version => 0.37
Registered save handlers => files user sqlite memcached

php -m | grep -i memcache
内存缓存

php -m | grep -i memcache
memcached

因此php似乎已将memcached作为模块加载,并且php info表示已加载并正在使用v .37.我还没有通过apache尝试过,我现在只是通过cli来使用它.有什么想法吗?

So php seems to have loaded memcached as a module, and php info says that it is loaded and is using v .37. I have not tried yet via apache, I've only been using this through cli right now. Any thoughts?

推荐答案

PHP中的memcached扩展有两个," memcached ".

There are two extensions for memcached in PHP, "memcache" and "memcached".

您似乎正在尝试使用其中一个("memcache"),但已安装了另一个("memcached").

It looks like you're trying to use one ("memcache"), but the other is installed ("memcached").

这篇关于PHP memcached致命错误:找不到类"Memcache"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆