Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed the memcache extension and also memcached. Now what do I need to chance in the php.ini file so that all sessions are handled in memcache?

share|improve this question
    
Obviously I mean "change", not chance. No idea of how I managed to make that type twice. –  Peter Johansson Nov 15 '10 at 14:40
    
I edited the title for you :) –  Tom O'Connor Nov 15 '10 at 14:41

1 Answer 1

up vote 1 down vote accepted

Simple answer:

session.save_handler = memcache

and

session.save_path="tcp://server:port"

Long answer, read these pages, and it should explain it a bit better.

share|improve this answer
    
about the server:port, any insight of what I should put there? –  Peter Johansson Nov 15 '10 at 14:42
    
Should it be "tcp://my.server.com:11211"?? –  Peter Johansson Nov 15 '10 at 14:49
    
Google gave me results such as these: session.save_path="udp://<memcache_server>:11211?persistent=1&weight=1&timeout=1‌​&retry_interval=15".... do you have an insight of how exactly this works...? –  Peter Johansson Nov 15 '10 at 14:51
    
Yep. Or you can use IP Address instead, like "tcp://127.0.0.1:11211" would refer to the memcached server on localhost. –  Tom O'Connor Nov 15 '10 at 14:52
    
Excellent. I will go with "tcp://127.0.0.1:11211". Do you have an insight in these type of params: "?persistent=1&weight=1&timeout=1&retry_interval=15"? –  Peter Johansson Nov 15 '10 at 14:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.