php sessions

Mikael Johansson mikael at synd.info
Sat Aug 18 09:08:54 UTC 2007


Hi,

Are you using the latest version of pecl/memcache (ver 2.1.2), and is it
compiled with session support?

Check the memcache revision in the phpinfo() output, should be at least
1.80. Also verify that the --disable-memcache-session switch hasn't been
used when compiling. Might be hard to do if you have installed the
extension from a package though, you could try installing it using pear like

 pear install pecl/memcache

//Mikael

Ing. Branislav Gerzo wrote:
> 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
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.danga.com/pipermail/memcached/attachments/20070818/a669cc76/signature.pgp


More information about the memcached mailing list