I am trying to set the Memcached parameter (disable compression) in the configuration file, but Yii2 continues to throw an error. What am I doing wrong?
Here is the configuration:
'cache' => [
'class' => 'yii\caching\MemCache',
'servers' => [
[
'host' => 'localhost',
'port' => 11211,
],
],
'useMemcached' => true,
'serializer' => false,
'options' => [
'Memcached::OPT_COMPRESSION' => false,
],
],
And error: 'yii \ base \ ErrorException' with the message 'Memcached :: setOptions (): wrong configuration setting
Any ideas?
If I do the same in simple PHP, it works fine:
$memcache = new \Memcached;
$memcache->setOption(\Memcached::OPT_COMPRESSION, false);
$memcache->addServers(
array(
array("HOST" => "127.0.0.1", "PORT" => 11211),
)
);
source
share