Help with memcached and session.save_path please

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Help with memcached and session.save_path please

Post by Charles Butcher »

In the last couple of weeks I've noticed a few persistent problems with the backend. Examples: the "internal page link" button in MicroTiny doesn't work properly, and I can't upload files using the main dialog in the File Manager. As far as I can see, these errors are independent of the user account and the browser.

I'm thinking this may relate to a persistent warning message that appeared recently:

Code: Select all

Warning: session_write_close(): using touch command with binary protocol is not recommended with libmemcached versions below 1.0.18, please use ascii protocol or upgrade libmemcached in /lib/misc.functions.php on line 81
Binary / ASCII? Does that make any sense in this context?

I've checked with my hosting provider and it seems that we have libmemcached 1.0.18 (which appears to be the latest version).

This is CMSms 2.2.8 with PHP 7.1.21. As far as I know, nothing has changed recently in my CMSms setup.

Under System Info > Session Save Path I have "No check because OS path". It's been like that for as long as I can remember, and has worked fine.

In php.ini I have `session.save_handler = memcache` and `session.save_path = "tcp://10.168.1.57:11211?persistent=0&weight=1&timeout=5&retry_interval=15"`.
I tried `session.save_handler = files` and `session.save_path = /tmp/cache` but this seemed to make no difference.

Any suggestions appreciated.

Charles
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Help with memcached and session.save_path please

Post by calguy1000 »

First. This is not a CMSMS issue. It's related to memcached and php

A quick google determines that this is an issue with php and/or memcached.

I have never played with memcached for session files. but the error message seems to indicate that PHP is not using the latest version of libmemcached. Perhaps something needs to be kicked.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Re: Help with memcached and session.save_path please

Post by Charles Butcher »

Thanks Robert. I contacted my hosting company first because I assumed it was their problem and that libmemcached needed an upgrade.

But what seemed strange is that I turn out to have the latest available version (1.0.18), and according to the warning message this ought to be OK. So I wondered if CMSMS might be involved after all.

I'll ask them to kick something.
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Re: Help with memcached and session.save_path please [solved

Post by Charles Butcher »

Just to finish this one off: The hosting company changed my session storage from memcache to disk and the problem seems to be solved. No idea why they could not sort out memcache, or what might have changed on the server to cause the problem in the first place, but I'm not going to argue.
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm
Location: Marlow, UK

Re: Help with memcached and session.save_path please

Post by scooper »

Just jumping into this thread with a bit more info because I've spent days trying to sort this out - I suspect with exactly the same hosting company.

First of all this is absolutely not a CMSMS specific issue - it's definitely down to the hosting company.

The issue occurs whenever trying to use memcached to handle sessions under a directory with 'admin' in the name (oh yeah).

So one solution that is CMSMS specific is to rename the admin directory to something non-adminy and update the config settings with the new directory name:

Code: Select all

$config['admin_dir']='hatstand';
another is, as mentioned, to switch session handling to files instead of memcached, and another is of course to switch to a hosting provider who just doesn't do this kind of thing.
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Re: Help with memcached and session.save_path please

Post by Charles Butcher »

Thanks scooper – that's really interesting. I'll PM you about the hosting company, since I'm probably too far off-topic already!

I used to use a different name for the admin directory, after reading somewhere that it might help stop people snooping around. But when I upgraded to CMSMS v2 I just went with the default.

I have to say that session storage on disk seems to be working fine. This is cheap hosting, and the site is often slow, especially on the backend. But at the moment it's looking good.
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

Re: Help with memcached and session.save_path please

Post by JamesT »

I have the same issue and I know which company you are talking about. To be honest, I think you are along the right lines when you mentioned changing hosts, and not only because of this.
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Re: Help with memcached and session.save_path please

Post by Charles Butcher »

Recommendations for good UK-focused hosting companies always welcome, but I'm on a low (i.e. spare time non-profit) budget and I do really like my existing provider, tso I do. Apart from this one craziness.
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

Re: Help with memcached and session.save_path please

Post by JamesT »

Fair enough, I admit personally I've had other sub-optimal experiences with them.

I've had good experience with a small UK provider, I'll PM it.

Incidentally I found another fix to the issue, set:

Code: Select all

memcached.sess_binary_protocol = 0
in

Code: Select all

public_html/.user.ini
This will set memcached to the ascii protocol like the error message suggests.
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 102
Joined: Sat Jul 05, 2008 8:25 pm
Location: Norfolk, UK

Re: Help with memcached and session.save_path please

Post by Charles Butcher »

Thank you James. I would never have discovered that by myself, but it looks so simple I'm surprised it was beyond the hosting company didn't do it that way. Good tip.
Locked

Return to “CMSMS Core”