php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28825 session_start(): Failed to initialize storage module
Submitted: 2004-06-18 11:06 UTC Modified: 2004-07-19 01:00 UTC
Votes:19
Avg. Score:4.8 ± 0.5
Reproduced:17 of 17 (100.0%)
Same Version:1 (5.9%)
Same OS:1 (5.9%)
From: searchadm at goschorn dot de Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.3.7 OS: Suse Linux 8.2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-06-18 11:06 UTC] searchadm at goschorn dot de
Description:
------------
php tells the following problem when i want to start new sessions

[17-Jun-2004 08:59:01] PHP Fatal error:  session_start(): Failed to initialize storage module: user (path: /tmp) in /www/mineralienatlas/htdocs/forum/index.php on line 109
[17-Jun-2004 08:59:03] PHP Fatal error:  session_start(): Failed to initialize storage module: user (path: /tmp) in /www/mineralienatlas/htdocs/forum/index.php on line 109
[17-Jun-2004 08:59:04] PHP Fatal error:  session_start(): Failed to initialize storage module: user (path: /tmp) in /www/mineralienatlas/htdocs/forum/index.php on line 109
------------------
here is the corresponding code
---- Start Code
if (empty($modSettings['enableCompressedOutput']))
        ob_start();

if (isset($_GET['PHPSESSID']) && preg_match('~[^A-Za-z0-9]~', $_GET['PHPSESSID']) != 0)
        die('Hacking attempt...');

// Start the session.
session_start(); // line 109 <--------------

if (version_compare(PHP_VERSION, '4.2.0') == -1)
{
        $HTTP_SESSION_VARS['php_412_bugfix'] = true;

        // And, 4.2.x and above auto-seed ;).
        srand(time());
}
.......
---- End Code

it's not easy to reproduce the problem because the server has to run several days to get the problem.
an "apachectl restart" solves the problem for some days again.

the /tmp has 777 right
there are only very few < 20 files in the directory when it crashes.

Part of my php.ini
---- Start
Session]
; Handler used to store/retrieve data.
session.save_handler = files
---- End

Saw some other threads here with the same problem but the threads are closed so i open an new one. Think the solve code should already be in 4.3.7 and it didn't help or isn't it?

Regards Stefan

----------------------
Apache 2.0.48
----------------------

---- php compile settings start
config.nice         [----]  0 L:[  1+ 0   1/ 64] *(0   /1298b)= #  35 0x23
#! /bin/sh
#
# Created by configure

'./configure' \
'--prefix=/prog/php' \
'--with-_lib=lib' \
'--disable-debug' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-ctype' \
'--enable-dbase' \
'--enable-discard-path' \
'--enable-exif' \
'--enable-filepro' \
'--enable-force-cgi-redirect' \
'--enable-ftp' \
'--enable-gd-imgstrttf' \
'--enable-gd-native-ttf' \
'--enable-inline-optimization' \
'--enable-magic-quotes' \
'--enable-mbstr-enc-trans' \
'--enable-mbstring' \
'--enable-mbregex' \
'--enable-shmop' \
'--enable-sigchild' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-track-vars' \
'--enable-trans-sid' \
'--enable-versioning' \
'--enable-wddx' \
'--with-bz2' \
'--with-dom=/usr/include/libxml2' \
'--with-ftp' \
'--with-gdbm' \
'--with-gettext' \
'--with-gmp' \
'--with-imap=yes' \
'--with-jpeg-dir=/usr' \
'--with-ldap=yes' \
'--with-mcal=/usr' \
'--with-mcrypt' \
'--with-mysql=/usr/local/mysql' \
'--with-ndbm' \
'--with-pgsql=/usr' \
'--with-png-dir=/usr' \
'--with-t1lib' \
'--with-tiff-dir=/usr' \
'--with-ttf' \
'--with-freetype-dir=yes' \
'--with-xml' \
'--with-xpm-dir=/usr/X11R6' \
'--with-zlib=yes' \
'--with-gd' \
'--with-openssl' \
'--with-curl' \
'--with-imap-ssl' \
'--with-iconv' \
'--with-mm' \
'--with-apxs2=/prog/apache/bin/apxs' \
'i686-pc-linux-gnu' \
"$@"
---- php compile settings end



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-25 11:46 UTC] pgale at netvigator dot com
I am experiencing what appears to be the same problem.  99% of the time users are able to login to my site and establish a session.  However, about once a month, the login script fails and php sessions cannot be established.  My ISP restarts apache and all works fine again. 

The ISP is running php4.2.3 on Linux 2.4.20-8smp#1 (as reported by phpinfo()

I have now set up php errors to be emailed to me.  Once an error message is caught I will add it to this bug report.  It could be some time.
 [2004-06-29 18:07 UTC] iliaa@php.net
When this error happens see if the directory where the 
sessions are being written to has enough space and if the 
system is not running out of file handles. 
 [2004-07-08 19:30 UTC] arnor at netvistun dot is
We (me and the company I work for) have also been having this problem for the last month. This error appears randomly. We made a script to a cronjob which is exicuted every minute. In a log of that script it looks like this error appears in about 6% of ALL request. 

You can view this log at: http://www.netvistun.is/session_log/log.php

the script that can cause this error (and is requested each minute) is at http://www.netvistun.is/session_log/index.php

php_info is at http://www.netvistun.is/session_log/info.php


The only thing you need to cause this error is:

<?php session_start() ?>

and that's it.

We have made owner/permission changes to the /tmp folder, we have tried clearing the temp directory, we have tried changing the session save directory to another dir. There is lots of space in the directory. We've tried restarting apache every 24 hours, we have done all of the workarounds which you see all over these bug tracks.

This bug has been appearing for a long time in the bugtrack (saw one from php 4.1.x), and is always closed with some "workaround".

We've experienced this problem ever since php 4.3.1, up to 4.3.7.
We are currently running :
php 4.3.7
Apache 1.3.31
Linux dist.: Fedora
Control panel: WHM (cPanel)

php config:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql' '--with-openssl' '--enable-discard-path' '--with-pear' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-xmlrpc' '--with-zlib' 

Session Support  enabled  
Registered save handlers  files user  

Directive Local Value Master Value 
session.auto_start Off Off 
session.bug_compat_42 On On 
session.bug_compat_warn On On 
session.cache_expire 180 180 
session.cache_limiter nocache nocache 
session.cookie_domain no value no value 
session.cookie_lifetime 0 0 
session.cookie_path / / 
session.cookie_secure Off Off 
session.entropy_file no value no value 
session.entropy_length 0 0 
session.gc_divisor 100 100 
session.gc_maxlifetime 1440 1440 
session.gc_probability 1 1 
session.name PHPSESSID PHPSESSID 
session.referer_check no value no value 
session.save_handler files files 
session.save_path /tmp2 /tmp2 
session.serialize_handler php php 
session.use_cookies On On 
session.use_only_cookies Off Off 
session.use_trans_sid On On 


Any other info I can give, I will give gladly (except root passwords of course :D)

I Hope I help.
 [2004-07-09 13:30 UTC] arnor at netvistun dot is
One more thing.

I've tried using a event program to trigger an event on each modification in the session save directory (in my case /tmp2).

The program runs chmod, chgrp, chown to give anybody rights to do anything (I know that's not wise, but I'm desperate) and a script that deletes all files that are 0 bytes in size (i noticed there were a lot of those).

This did not help at all!
 [2004-07-09 14:32 UTC] searchadm at goschorn dot de
the problem is not a diskspace problem and not a file count problem.
 [2004-07-09 14:57 UTC] arnor at netvistun dot is
I've tried hundreds of things for many days, but I'm beginning to suspect that this is not a fault in php but a proplem caused by the control panel I'm using: cPanel/WHM. I blamed them at first but they looked at the problem with root access to our server for days, but said at the end that this is a problem with php... everybody points fingers.

I even contacted a problem solving company, but they simply said that at this point they "do not support fedora" environments (even though they support most other distributions)...

Btw... I'm willing to pay money somebody can fix this.
 [2004-07-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 28 08:01:25 2023 UTC