IronCache as Memcached server on PHP returns code 47 (?)

247 Views Asked by At

When following the IronCache guide, I receive a misterious code 47 trying to set any key - including the requested oauth token.

This code is not present in the PHP documentation. Is this related to the fact IronCache only supports the text protocol? If yes, how would we use IronCache as a Memcached server in PHP?

As per this answer, 47 means MEMCACHED_SERVER_TEMPORARILY_DISABLED. So what? IronCache advertises Memcache support but actually their servers are not even working?
This would not be related to their text-only protocol, since by default PHP uses the text protocol. However, I did tested forcing Memcached::OPT_BINARY_PROTOCOL to false, but it still made no differen

$cache = new Memcached;
$cache->addServer('cache-aws-us-east-1.iron.io', 11211);
$cache->set('oauth', getenv('IRON_CACHE_TOKEN').' '.getenv('IRON_CACHE_PROJECT_ID').' general', 0);
}
var_dump($cache->getResultCode()); //47 ?!
1

There are 1 best solutions below

0
Alex On

Try to use the port 80 instead of 11211, i.e. replace

$cache->addServer('cache-aws-us-east-1.iron.io', 11211);

with

$cache->addServer('cache-aws-us-east-1.iron.io', 80);