Shredsauce
Shredsauce

Reputation: 63

memcached get function always returns 'bool(false)'

Memcached should be installed correctly. I'm using php 5.4

memcached settings

With this code I should get '99' as a result but I end up with 'bool(false)'.

  $m = new Memcached();
  $m->addServer('localhost', 11211);

  $m->set('int', 99);

  var_dump($m->get('int'));

Upvotes: 1

Views: 1816

Answers (1)

Anand From Pie.host
Anand From Pie.host

Reputation: 1233

This has been asked long ago, yet ranks up at Google search so the answer might be helpful for someone looking for the answer to this question.

Check if Memcached is really installed

Run the command telnet 127.0.0.1 11211 and if the connection fails then you need to install Memcached or check if your Firewall allows the port 11211 connections.

For Ubuntu, the command is sudo apt-get install memcached

Upvotes: 1

Related Questions