MemcachePool::get(): Server localhost (tcp 11211, udp 0) failed with: Network timeout
I had the same issue, with php on Windows 10 and Memcached installed on Ubuntu (running in the Windows Subsystem for Linux)
Im my case, the problem was that localhost
resolves to [::1]
:
>ping localhostPinging SURFACE-PRO-FRA [::1] with 32 bytes of data:
And Memcached by default listens only on 127.0.0.1.
To solve the issue, you can make Memcached listens also on the ipv6:
$ sudo vi /etc/memcached.conf
Replace
-l 127.0.0.1
with:
-l 127.0.0.1,::1
And then
sudo service memcached restart
Or alternatively, make your app connect to 127.0.0.1 instead of localhost.