php bug :: important ::

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
PHPmaster
Posts: 40
Joined: Sun 19. Mar 2006, 15:39

php bug :: important ::

Post 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
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post 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
PHPmaster
Posts: 40
Joined: Sun 19. Mar 2006, 15:39

Why not on every host?

Post 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
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post 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.
PHPmaster
Posts: 40
Joined: Sun 19. Mar 2006, 15:39

function _initSession

Post 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
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: php bug :: important ::

Post 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();
PHPmaster
Posts: 40
Joined: Sun 19. Mar 2006, 15:39

Solved???

Post 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
User avatar
Oliver Georgi
Site Admin
Posts: 9909
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

change provider. Such ini value has to be set in php.ini and should be set by default!!!

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply