Page 1 of 1

php bug :: important ::

Posted: Tue 15. May 2007, 17:51
by PHPmaster
I posted this in the forum today:

Hi, I have a phpwcms1.2.6 website that was always performing o.k. Now after a year or so, I have this error sometimes when I click in the horisontal menu. This is the error:Fatal error: session_start() [function.session-start]: Failed to initialize storage module: user (path: /tmp) in /usr/local/psa/home/vhosts/xappix.nl/httpdocs/index.php on line 47

It's not every time but 1 out of ten which is still too much if you ask me.
Does somebody know what this is and how to solve it?

Thanks for any advise.
Jeroen

I contacted my host wit the question. This is the reply:

The error you receive is a bug in php. Look for info about this bug following link:

http://bugs.php.net/bug.php?id=25876

If youy copy this code on all pages the error will be solved:

ini_set("session.save_handler", "files");

What's the best way to do this????


Please advise,

Jeroen

Posted: Tue 15. May 2007, 22:03
by DeXXus
When reported by someone else recently, this problem was mentioned and this solution suggested.

BUT it may not be a CURE... it may only a lessen the frequency:

http://www.phpwcms.de/forum/viewtopic.p ... age+module

Why not on every host?

Posted: Wed 16. May 2007, 00:17
by PHPmaster
I work with one host mostly were I have several 1.2.6. sites, never saw something like this. My own website is hosted by this host where the error appears and this host suggests to put: ini_set("session.save_handler", "files"); on every file WHAT DO YOU THINK? Whould that be a solution? Can't this be done globally in a config? I suppose changing to another version does not solve it.

Hope you can advise me,
Jeroen

Posted: Wed 16. May 2007, 01:58
by DeXXus
I don't believe you would want to put it in every file. It is only triggered in specific circumstances.
Since your webhoster configuration will continue to consist of this bug... you should just try the code-change that I mention in that other thread.
That should be your next step because that is when the bug is triggered. It is where all visitors, to your site, start their session.

function _initSession

Posted: Wed 16. May 2007, 09:48
by PHPmaster
Hi DeXXus,

There's no such code or such function in my default.inc.php perhaps because it's version 1.2.6

Can you please advise?
Jeroen

Re: php bug :: important ::

Posted: Wed 16. May 2007, 10:51
by DeXXus
PHPmaster wrote:This is the error:Fatal error: session_start() [function.session-start]: Failed to initialize storage module: user (path: /tmp) in /usr/local/psa/home/vhosts/xappix.nl/httpdocs/index.php on line 47
Sorry! :oops: Forgot you mentioned using earlier version. Your error message tells you where (line 47 of index.php).

~Try~

REPLACE:

Code: Select all

if(!$IS_A_BOT) {
	session_name('hashID');
	session_start();
WITH:

Code: Select all

if(!$IS_A_BOT) {
   @ini_set( 'session.save_handler' , 'files' );
	session_name('hashID');
	session_start();

Solved???

Posted: Wed 16. May 2007, 12:49
by PHPmaster
Hi DeXXus,
I think this cures the problem. I changed the index with your code and tried the site, looks good!! :lol:

Is the cure for 1.2.6 more healing than for 1.3.3?
Thanx for your advise, it saved me a lot of time.

Best regards,
Jeroen

Posted: Wed 16. May 2007, 16:07
by Oliver Georgi
change provider. Such ini value has to be set in php.ini and should be set by default!!!

Oliver