我从php.net粘贴了在 php 中使用 memcached 的示例,我得到:
Fatal error: Class 'Memcache' not found
我的 php.ini 中有这个:
[memcache]
memcache.hash_strategy = "一致"
memcache.max_failover_attemps = 100
memcache.allow_failover = 1
以下是分别来自 php -i 和 php -m 的信息:
php -i | grep -i memcache
memcached
memcached 支持 => 启用
libmemcached 版本 => 0.37
注册保存处理程序 => 文件用户 sqlite memcachedphp -m | grep -i memcache
memcached
所以 php 似乎已经将 memcached 作为一个模块加载,并且 php info 说它已加载并且正在使用 v .37。我还没有通过 apache 尝试过,我现在只是通过 cli 使用它。有什么想法吗?