From: Demian K. <dem...@vi...> - 2012-05-21 15:29:44
|
There's actually a big warning in the PHP manual: When using objects as session save handlers, it is important to register the shutdown function with PHP to avoid unexpected side-effects from the way PHP internally destroys objects on shutdown and may prevent the write and close from being called. Typically you should register 'session_write_close' using the register_shutdown_function()<http://us.php.net/manual/en/function.register-shutdown-function.php> function. This seems to suggest that we should really be doing that in the trunk whether or not APC is involved. I'll put it in there now. - Demian From: Eoghan Ó Carragáin [mailto:eog...@gm...] Sent: Monday, May 21, 2012 11:19 AM To: Demian Katz Cc: vuf...@li... Subject: Re: [VuFind-Tech] Sessions not being written when APC enabled Thank you - that's fixed it. I had actually added that before (again with your help, if I recall!) to fix another odd caching error but I never committed the change back to our local svn repository so lost it. Is there a reason not to include it with the trunk? Many thanks, Eoghan On 21 May 2012 15:52, Demian Katz <dem...@vi...<mailto:dem...@vi...>> wrote: Did you see Graham Seaman's workaround here? http://vufind.org/wiki/performance#php_tuning It looks like he uses register_shutdown_function('session_write_close'); in index.php to ensure that the session gets dumped. He reported that workaround quite some time ago and I haven't heard of any problems with it, so it's probably worth a try. - Demian From: Eoghan Ó Carragáin [mailto:eog...@gm...<mailto:eog...@gm...>] Sent: Monday, May 21, 2012 10:49 AM To: vuf...@li...<mailto:vuf...@li...> Subject: [VuFind-Tech] Sessions not being written when APC enabled Hi, Has anyone else run into problems with Vufind sessions when APC cache is enabled? With APC enabled, our vufind instace writes the first session after an apache restart but nothing after that. Disabling APC fixes the problem. We've configured FileSession session types in config.ini but switch to MySQLSession doesn't help with APC is enabled. I've found a few threads [1][2][3] which suggest that calling session_write_close() in the php solves this but would like some advice on where best to put this in vufind etc., or perhaps there is another solution I've missed? Many thanks, Eoghan [1] https://bugs.php.net/bug.php?id=58763 [2] http://stackoverflow.com/questions/3547142/session-problems-when-apc-is-turned-on [3] http://news.php.net/php.internals/46999 |