Can't connect to memcache

apache, caching, memcached, php

Solution

You need to actually install the `memcached` server so that it can be connected to. On CentOS, this can be done with...

sudo yum install memcached

(on debian flavors of linux, use `apt-get` instead of `yum`)

Problem

I am trying to connect to memcache as they suggest: ``` $memcache = new Memcache(); $memcache->pconnect('localhost',11211); ``` But i get: ``` Notice: Memcache::pconnect() [memcache.pconnect]: Server localhost (tcp 11211) failed with: Connection refused (111) in /home/user/public_html/website.com/includes/basedatos.php on line 26 ``` Any idea why?

Original source