本地计算机上的两个内存缓存服务器



我正在尝试在具有多个服务器的MemCache上创建一个演示。我已经在本地计算机上安装了 WAMP 和 XAMPP。Wamp可以通过localhost访问,XAMPP可以通过localhost:7980访问。

我已经在两台服务器上安装了Memcache(安装了正确的版本(。在两台服务器上phpinfo()显示安装了内存缓存。我的一个 memcache 服务器端口是11211个,第二个 memcache 服务器端口是11212个。我正在使用yii2,我的配置如下。

'cache' => [
'class' => 'yiicachingMemCache',
'servers' => [
[
'host' => 'localhost',
'port' => 11211,
'weight' => 60,
],
[
'host' => 'localhost:7980',
'port' => 11212,
'weight' => 60,
],
],
],

我得到以下错误

MemcachePool::get(): Server localhost:7980 (tcp 11212, udp 0) failed with: Malformed VALUE header (0)

请指导我哪里出错了。任何帮助将不胜感激。

通过在另一个端口上启动服务器可以解决此问题。我使用了以下命令,它起作用了。memcached.exe install -p 11212

最新更新