Php 我的Mac OS上的内存缓存问题

Php 我的Mac OS上的内存缓存问题,php,macos,xampp,localhost,memcached,Php,Macos,Xampp,Localhost,Memcached,我刚刚在Mac OS上安装了memcached。它安装得非常完美,当我在终端中键入memcached时,我得到以下信息: failed to listen on TCP port 11211 tcp listen: Address already in use 我的本地主机中有一个脚本,其中包含: $memcache = new Memcache(); But I get an error thrown saying Fatal error: Class 'Memcache' not foun

我刚刚在Mac OS上安装了memcached。它安装得非常完美,当我在终端中键入memcached时,我得到以下信息:

failed to listen on TCP port 11211 tcp
listen: Address already in use
我的本地主机中有一个脚本,其中包含:

$memcache = new Memcache();
But I get an error thrown saying Fatal error: Class 'Memcache' not found.
我如何让memcached工作,是不是因为没有监听端口11211,这可能不会使memcached工作

当I
sudo pecl install memcache
显示


pecl/memcache已安装,与已发布的版本2.2.7相同安装失败

您是否检查了
memcached
是否尚未启动?机会是有的。至于“致命错误:找不到'Memcache'类。”错误-它与
memcached
是否启动和运行无关。还有一件事:
memcache
memcached
不是一回事。查看更多信息。$memcache=newmemcached;$memcache=newmemcache;两者都不起作用,我尝试了这个命令ps-e | grep memcache | grep-v grep它显示21476??0:00.14/usr/local/bin/memcached-d-p 11211 23196??0:00.05 memcached-d-p8000和netstat-a-ptcp | grepLISTEN@mrun当我运行sudo pecl install memcache时,它显示pecl/memcache已安装,但当我运行脚本时,它显示致命错误它已安装,但在php.ini中是否已启用?您可以通过运行
php-m | grepmemcache
来查找,并查看是否有任何条目。