ID:               25876
 Comment by:       coadmin at hostings dot pl
 Reported By:      golden at riscom dot com
 Status:           Closed
 Bug Type:         Session related
 Operating System: freebsd 4.8
 PHP Version:      4.3.3
 New Comment:

We have the same problem.
FreeBSD 4.10-STABLE, PHP 4.3.8, Apache 1.3.31

how to repeat:
<?
  session_start();
  echo $PHPSESSID;
?>

then refresh the website a many times.
you will receive an error:

Fatal error: session_start(): Failed to initialize storage module:
user (path: /tmp) in /home/xxx/public_html/index.php on line 2

the problem still exists also when using custom dir for saving session
files.


Previous Comments:
------------------------------------------------------------------------

[2004-08-22 04:27:16] whitehat44 at hotmail dot com

i found something out euhm..i hope it helps in tracking this bug down
i use php-nuke and imported a tweaked oscommerce mall version
both use sessions in different way but both are loaded the same time , 
and when set 
ini_set('session.save_handler', 'files'); the bug is gone
However inside the script it is told to store sessions into mysql but
in the sessions file (this normaly carry same session functions for
many script) the code : ini_set('session.save_handler', 'files'); is
called before the session_start.
The real error occurs when it want to execute this function:
function tep_session_register($variable) {
    global $session_started;

    if ($session_started == true) {
      return session_register($variable);
    } else {
      return false;
    }
  }
in ALL imported scriptfiles to nuke each file have:
tep_session_close(); what Holds:
function tep_session_close() {
    if (PHP_VERSION >= '4.0.4') {
      return session_write_close();
    } elseif (function_exists('session_close')) {
      return session_close();
    }
  }
i think when want to track a bug....you must now what main php
functions are called and i can asure you these 2 have a conflict, i
only hope this atempt to help is putting it in the good direction

------------------------------------------------------------------------

[2004-08-16 17:32:30] ron at dse dot nl

Clearing the x-bit did not solve the problem. Probably this bug is not
really related to the X-bit-hack but merely very similar in it's
effects.

The way to work around this bug is by avoiding php ini settings in all
.htaccess files on your Apache server and instead put them in the
application. For Drupal for instance, I moved these settings to
conf.php by using ini_set() there. Squirrelmail even has a special
config_local.php that you can use for this.

More info on my particular setup:

Apache 1.3.29 with o.a. mod_suexec and mod_rewrite
PHP 4.3.8 (but same issue with 4.3.4)
applications installed within same vhost

Hope this will help developers find this annoying bug.

------------------------------------------------------------------------

[2004-08-08 20:48:47] ron at dse dot nl

Spent over a day troubleshooting as well. I think the real problem is
described here: http://bugs.php.net/bug.php?id=25753

Although the suggested bug fix over there seems to have been
incorporated in up to version 4.3.8, the behaviour still exists. The
bug is easily triggered by running Squirrelmail and Drupal off the same
Apache server as in my case. Drupal sets the session.save_handler to
'user' by a directive in the .htaccess file that comes with the
installation. If, by accident, the next request by the same Apache
child process is for a squirrelmail user, then the squirrelmail
session_start() fails with 'Failed to initialize storage module'. This
happens because the session.save_handler is still set to user instead
of file, it is not reset to the master value for the child process. It
is a matter of random luck which child process will serve the
squirrelmail request so that explains the intermittent occurance.

As mentioned by rasmus this "only happens on text/html files with the
executable bit set". Clearing the bit for all of the squirrelmail PHP
files seems to be useful a workaround. Just perform a

find . -name '*.php' -type f -exec chmod -x {} ';'

in your squirrelmail (or other PHP application) directory and restart
your Apache server (for some reason this was necessary).

------------------------------------------------------------------------

[2004-08-08 01:01:54] mail at ferryvink dot nl

Typo in the email address of my last post. ...

------------------------------------------------------------------------

[2004-08-08 01:00:42] mail at ferryviuk dot nl

Got the "Failed to initialize session module" error as well. The
session.save_handler reset to files worked when I also restarted the
webserver! Seems logical but can easily be forgotten. Didn't see it in
al these posts. Hell, I almost installed a new and fresh php4.

hope it helps.

Cheers
FHV

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/25876

-- 
Edit this bug report at http://bugs.php.net/?id=25876&edit=1

Reply via email to