0
我刚刚安装内存缓存的XAMPP在OS X山狮,我尝试使用运行它无法获得Memcache的工作
$memcache = new Memcache();
$memcache>connect('127.0.0.1', 11211) or die ("Could not connect");
这将返回:
Fatal error: Class 'Memcache' not found in /Applications/XAMPP/xamppfiles/htdocs/mysite/myfile.php on line 123
我能做些什么来解决这个问题?
我使用this guide
在我的php.ini文件安装内存缓存我有extension="memcache.so"
在phpinfo.php的我有mod_mem_cache
我试过你的代码,它仍然是一样的错误。错误指向的行是:'$ memcache = new Memcache();'我也尝试运行'php --info | grep'^ memcache''但是不会返回任何东西。一点都没有。 –
有什么想法可能是错的? –
然后我很肯定你没有安装memcache(或memcached)库。查看上面提到的XAMPP安装手册。 您是否重新启动Apache实例以加载您所做的更改? (在指南中也提到) – NKL