J
J
joger2012-07-14 11:00:43
PHP
joger, 2012-07-14 11:00:43

Error with Memcached::set

I can't find an error in 3 lines of code.

$m = new Memcached();
var_dump($m->addServer('localhost', 11211));
var_dump($m->set("aaaa","bbb"));


we get:
bool(true)
bool(false)


on get and replace is also false.

Is my eye blurred or is the problem still in the Memcached server?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2012-07-14
@iSage

Memcached::addServer() adds the specified server to the server pool. No connection is established to the server at this time
Therefore, it returns true (false is only returned when the parameters are invalid).
See what Memcached::getResultMessage() says after that

J
joger, 2012-07-16
@joger

through trial and error, it was found that when replacing "localhost" with the ip of the server, the problem disappears

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question