我正在尝试使用 memcache 支持运行 php,但我不断在 config.php 文件中收到此错误消息。
<b>Fatal error</b>: Class 'Memcache' not found in <b>
下面是相关的 config.php 片段
require 'lib/Minify/Cache/Memcache.php';
$memcache = new Memcache;
if(@$memcache->connect('127.0.0.1', 11211)) {
$min_cachePath = new Minify_Cache_Memcache($memcache);
}
上面代码段中的第二行导致了这个问题。我已经使用 brew 安装了 php56。我已经使用 brew 安装了 php56-memcache 我还使用 brew 安装了 php56-memcached
当我运行时,php -i | grep memcache
我可以看到 memcache 和 memcached 都启用了。
请帮帮我。正如评论中提到的,这不是PHP memcached 致命错误的重复:找不到类“Memcache”,因为我已经安装了两个模块,但我仍然无法使用。