Customized Session Handler can not work for PHP 5.1.6 and CentOS 5.5
| From: | Mingda | Date: | Sun, 15 Apr 2012 06:53:40 +0000 |
| Subject: | Customized Session Handler can not work for PHP 5.1.6 and CentOS 5.5 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-317560@lists.php.net to get a copy of this message | ||
Hi, All,
I can't see the post I sent several hours ago, if repeated, please reply to this one. Thanks!
System: CentOS 5.5; PHP version is 5.1.6.
I met a strange problem associate with session_save_handler in current environment(The same code can work well in my local windows platform and ubuntu system).
I just want to use a customized session save handler to be triggered, so that I can call my own logic to handling the session. The testing in local is pretty great but when migration to the VPS, it bring me the following error:
Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: /tmp)
The default value for session save handler and session save path in php.ini are:
session.save_handler = files
session.save_path = "/tmp"
session.name = PHPSESSID
And the bottom are the code for the session handler. I first called ob_start(), and after calling session::init(), I called session_start(). Then the fatal error happen. It did not trigger any function in the "session" class.
I tried change the php.ini from session.save_handler = user, but the error remains. And I found no matter what session.save_handler type is, after calling session_set_save_handler(), the session.save_handler will always automatically changed to 'user', that's why the Fatal error info shows user (path: /tmp).
Can anybody help me out for such error? I was stuck by this issue for more than 2 days, but still haven't get any clue!
You can view more details from stackoverflow if you want. Here is the link:
http://stackoverflow.com/questions/8845924/session-set-save-handler-class-for-database-not-working