php sessions

Dieter Schmidt flatline at stresstiming.de
Sat Aug 18 09:11:30 UTC 2007


Ing. Branislav Gerzo schrieb:
> 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
>   
Hi,

I think, there is an  ini_set('session.save_handler', 'files'); in one
of your include files and for that the session handler tries to access
tcp://my.server.com:11211 as a file instead of using the memcache extension.
Hope it helps you.

grtx from germany.

Dieter

> 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