php sessions

Ing. Branislav Gerzo 2ge at 2ge.us
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:
extension=memcache.so
session.save_handler = "memcache"
session.save_path = "tcp://my.server.com:11211"

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/os.org) 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://my.server.com:11211');

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

Funny thing is, I use memcache for storing some data already in
program, so "tcp://my.server.com:11211" 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!

config:
memcache 1.2.2
FreeBSD 7.0
PHP Version 4.4.6
Lighttpd 1.4.13

/brano



More information about the memcached mailing list