I am moving some servers from Ubuntu 16 to Ubuntu 18 and I am having trouble getting php sessions and memcache working.
On the current (Ubuntu 16) setup, there are three servers sharing sessions using memcache (note: not memcached!).
I believe I have replicated the current setup on the new servers, but it doesn't work and I get the following error in the apache error log:
PHP Warning: session_start(): Failed to read session data: memcache (path: tcp://10.32.82.6:11211?persistent=1&weight=1&timeout=1&retry_interval=15,tcp://10.32.82.7:11211?persistent=1&weight=1&timeout=1&retry_interval=15,tcp://10.32.82.8:11211?persistent=1&weight=1&timeout=1&retry_interval=15)
In phpinfo()
I see that the session.save_path
and session.save_handler
are set correctly (as reflected in the log message above).
If I go to any one of the three machines, I can telnet to port 11211 on any of the other servers.
If I look at the logs (set to -vv), I can see stuff happening and quite a few "NOT_FOUND" statements, but I don't really know how to interpret these logs.
In /etc/php/7.2/mods-available/memcache.ini
:
memcache.allow_failover="1"
memcache.max_failover_attempts="4"
memcache.session_redundancy="4"
On the current (Ubuntu 16) setup, I remember trying both memcached and memcache and figuring out that memcache was the right solution. Trying memcached on the new setup is my last resort, as I feel that memcache should work, and I am just missing something, or something has changed in Ubuntu 18 that I am not aware of.