Page 1 of 1

joomla + memcached = some session problems

Posted: Sat Dec 19, 2009 1:32 pm
by serjs
Hi i have some troubles with memcached + joomla. I installed and started memcached => joomla options cache type memcache (write memcache options) and session type - memcache too. Save all options and after cann't login to site and administration. In error log nothing, when i change cache to database i can login, where is the problem?

Re: joomla + memcached = some session problems

Posted: Thu Jan 07, 2010 5:40 am
by joomfriend
Hello serjs,

Check that memcache is installed properly. Installing and setting memcached is a little bit tricky. Yes! memcached MUST be properly configured otherwise your site won't respond well. I suggest you contact your host and let them install and set memcached for you.

Re: joomla + memcached = some session problems

Posted: Thu Jan 07, 2010 9:48 am
by vipinsahu
hey i think u haven't check the session time ?

Re: joomla + memcached = some session problems

Posted: Wed Feb 03, 2010 11:25 pm
by serjs
Where i must config memcached? I install it, set some options on my rc.d script
command_args="-d -u ${memcached_user} -l myip -L"
In joomla:
Cache Settings
Cache Handler MemoryCache
Persistent Memory Cache Yes
Memory Cache Server myip and port
netstat -a | grep 11211 say memcached worker
echo stats | nc 127.0.0.1 11211 give me some stat

Session Settings
When i set Memory Cached for session, i logoff and after i can't logon.

@vipinsahu, my session time = 30 min as default

Re: joomla + memcached = some session problems

Posted: Mon Feb 22, 2010 7:52 am
by serjs
UPD
When i set error layout for max, i hove some warn's on my log file.

Code: Select all

Notice: MemcachePool::delete() [memcachepool.delete]: Server 127.0.0.1 (tcp 11211, udp 0) failed with: CLIENT_ERROR bad command line format. Usage: delete <key> [noreply] (0) in /home/site/data/www/example.org/libraries/joomla/session/storage/memcache.php on line 209

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/site/data/www/example.org/libraries/joomla/session/storage/memcache.php:209) in /home/site/data/www/example.org/libraries/joomla/session/session.php on line 423

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/site/data/www/example.org/libraries/joomla/session/storage/memcache.php:209) in /home/site/data/www/example.org/libraries/joomla/session/session.php on line 423

Warning: Cannot modify header information - headers already sent by (output started at /home/site/data/example.org/libraries/joomla/session/storage/memcache.php:209) in /home/site/data/www/example.org/libraries/joomla/session/session.php on line 426

Re: joomla + memcached = some session problems

Posted: Mon Feb 22, 2010 8:15 am
by bmkdigital
Looks like joomla is having problems using memcached that is then generating a error that is getting out put before the headers.

I'd say you cannot login as it cannot save the session data.

Re: joomla + memcached = some session problems

Posted: Mon Feb 22, 2010 8:32 am
by serjs
And whereis the problem? I wrote some example to work with the sessions with mecache and there everything works. In the case of the joomla session does not work. Not sure what the problem with memcache or its configuration.

Re: joomla + memcached = some session problems

Posted: Mon Feb 22, 2010 8:55 am
by bmkdigital
Without seeing some more log I'm not sure, the first line gives some clues as memcached is getting told to delete but does not seem to like how it was asked and suggests it's a client error. If I did not have anything else to go on I would guess at some sort of miss match between the version joomla was written for and the version you have installed.

Re: joomla + memcached = some session problems

Posted: Mon Feb 22, 2010 9:04 am
by serjs
There is no more error, notice or warn messages on my log file. I have latest joomla on my server and memcached-1.4.4 + PECL/memcache-3.0.4

Re: joomla + memcached = some session problems

Posted: Fri Apr 16, 2010 12:40 am
by WillSpencer
serjs wrote:Hi i have some troubles with memcached + joomla. I installed and started memcached => joomla options cache type memcache (write memcache options) and session type - memcache too. Save all options and after cann't login to site and administration. In error log nothing, when i change cache to database i can login, where is the problem?
I am seeing the same thing on my Joomla site. I have to edit configuration.php manually before I can log back into my site.

This same thing happens when I try to use APC as the session manager in Joomla.

Both APC and Memcache are configured and working properly on my server -- but Joomla is not working correctly with either.

This looks like a bug to me.

Re: joomla + memcached = some session problems

Posted: Fri Apr 16, 2010 6:40 pm
by turnkeye
It is bug of memcache, install the latest version.

http://code.google.com/p/memcached/wiki/ReleaseNotes144

----------------------------------------------------------------
Fixes

Add partial backwards compatibility for delete with timeout 0
Before version 1.4.0, there was an optional argument to delete that would allow a client to specify that a deleted object should exist in the cache after the deletion occurred such that add operations would fail even though objects did not appear in the cache.

This feature was removed completely in 1.4.0, but a parser bug caused it to slip through. The bug was fixed in 1.4.3. If anyone was attempting to use it legitimately in the 1.4 series, it would simply not work as expected.

The 1.4.4 backwards compatibility change allows specifically the value of 0 (i.e. non-lingering delete), while continuing to reject others. This will satisfy clients that always wish to send a value even when they do not wish the item to linger.

Re: joomla + memcached = some session problems

Posted: Fri Apr 16, 2010 7:36 pm
by WillSpencer
The current version supported by Ubuntu is memcached 1.2.8.

Re: joomla + memcached = some session problems

Posted: Fri Apr 16, 2010 7:43 pm
by turnkeye
WillSpencer wrote:The current version supported by Ubuntu is memcached 1.2.8.
I sure it is possible to find Debian package of Memecache 1.4 and install it to Ubuntu.
Ubuntu is Debian based OS.

Re: joomla + memcached = some session problems

Posted: Fri Jun 25, 2010 2:29 am
by binhle410
Try setting you session cache is database and NOT memcache
It should work.

Re: joomla + memcached = some session problems

Posted: Fri Dec 17, 2010 10:54 am
by freeze1992
binhle410 wrote:Try setting you session cache is database and NOT memcache
It should work.
yea i get that but how am i able to do that if i can't login to the administrator anymore?
i already tried to find it in all the storage .php files but i couldn't find it there

Re: joomla + memcached = some session problems

Posted: Fri Dec 17, 2010 11:10 am
by WillSpencer
freeze1992 wrote:
binhle410 wrote:Try setting you session cache is database and NOT memcache
It should work.
yea i get that but how am i able to do that if i can't login to the administrator anymore?
i already tried to find it in all the storage .php files but i couldn't find it there
Edit your configuration.php file:

Code: Select all

var $cache_handler = 'file';

Re: joomla + memcached = some session problems

Posted: Fri Dec 17, 2010 11:25 am
by freeze1992
WillSpencer wrote:
freeze1992 wrote:
binhle410 wrote:Try setting you session cache is database and NOT memcache
It should work.
yea i get that but how am i able to do that if i can't login to the administrator anymore?
i already tried to find it in all the storage .php files but i couldn't find it there
Edit your configuration.php file:

Code: Select all

var $cache_handler = 'file';
its exact the same in my file

Re: joomla + memcached = some session problems

Posted: Sun Mar 20, 2011 1:58 pm
by Entry66
I had the same problem and solved it by editing configuration file with the following setting

var $session_handler = 'database';

Re: joomla + memcached = some session problems

Posted: Fri Sep 16, 2011 2:37 am
by JonathanJW
It is best to ask your hosting service to reinstall memcached and joomla and that may solve the problem.

Re: joomla + memcached = some session problems

Posted: Thu Jun 28, 2012 10:43 pm
by 1h_hackman
In order to make Joomla to use memcache for session caching you need to manually edit the configuration.php and change the $session_handler from 'database' to 'memcache'

And here is what is missing everywhere, you need to add a new option memcache_settings:

Code: Select all

public $memcache_settings = 'a:3:{s:10:"persistent";s:1:"0";s:11:"compression";s:1:"0";s:7:"servers";a:1:{i:0;a:2:{s:4:"host";s:9:"127.0.0.1";s:4:"port";s:5:"11211";}}}';
This is a serialized multy-dimentianal array. I use this code to generate the above string:

Code: Select all

 $a = array(
   "persistent" => "0", 
   "compression" => "0", 
   "servers" => array(
     "0" => array(
       "host" => "127.0.0.1", "port" => "11211")
     )
   );

echo(serialize($a));
If you don't add the memcache_settings option your sessions will never work with memcache.

Re: joomla + memcached = some session problems

Posted: Thu Oct 29, 2015 6:05 pm
by strudel
Some Joomla sites just might not work well or at all with memcache, particularly sites with third-party add-ons. See:

https://www.cloudaccess.net/about-us/bl ... -site.html