php sessions

Ing. Branislav Gerzo 2ge at
Sat Aug 18 08:55:18 UTC 2007

Hello all,

I use memcache on my servers for storing some critical data using PHP.
Now I decided, it should be nice to use it for sessions - now I store
them to mysql. Problem is:

1. I tried changed my php.ini to:
session.save_handler = "memcache"
session.save_path = "tcp://"

I get in log:
FastCGI-stderr: PHP Fatal error:  session_start() [<a href='function.session-start'>function.session-start</a>]:
Failed to initialize storage module: memcache (path: /tmp/sessions/ in index.php on line 107

2. I tried add to index.php at start:
ini_set('session.save_handler', 'memcache');
ini_set('session.save_path', 'tcp://');

in log is:
FastCGI-stderr: PHP Warning:  ini_set() [<a href='function.ini-set'>function.ini-set</a>]:
Unable to access tcp:// in index.php on line 28

Funny thing is, I use memcache for storing some data already in
program, so "tcp://" works for sure (I am
connecting to it at start, and then normally use it). What else I
should check, so sessions will work with memcache ?

Thank you very much!

memcache 1.2.2
FreeBSD 7.0
PHP Version 4.4.6
Lighttpd 1.4.13


More information about the memcached mailing list