How to Fix the Memcache Error
-
When W3 Total Cache was updated to 0.9.5, connections to Memcache broke. This is because of a change in the code in W3TC which now checks for for the Memcached class (Memcached, with a D on the end). For those who don’t know, Memcache and Memcached are two different technologies, though they are both named very similarly. Memcache is supported on PHP 5.5 and 5.6 but not on PHP 7. Memcached is available on 5.5, 5.6, and PHP 7.
So here is what happens. Pre 0.9.5, W3TC did not check for check the MemcacheD class. Because of this, it automatically went straight for Memcache if you gave it an IP or socket. The default socket for A2 is something like this:
unix:///opt/memcached/run/username/memcached-1.sock
Afte the update, W3TC started checking for MemcacheD first. This is what threw the train off the tracks, so to speak. MemcacheD uses a different path format than Memcache does. Because of this, the unix:// path that is default will not work. You will need to update your path to this:
//opt/memcached/run/username/memcached-1.sock
Notice how the only difference is to remove the unix:// part and leave a single slash at the start. Do that and you’re good to go. You can even use PHP 7 or 7.1 if available on your server. Just remember to set your ‘username’ correctly in the path.
- The topic ‘How to Fix the Memcache Error’ is closed to new replies.