For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > February 2008 > phpMyAdmin won't run -- apparently a PHP bug









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author phpMyAdmin won't run -- apparently a PHP bug
Jonathan Sachs

2008-02-20, 10:04 pm

I just tried to install phpMyAdmin on my system, and I can't get it to
work. When I tried to run the setup procedure (setup.php) I got the
following message:

Fatal error: session_start() [<a
href='function.session-start'>function.session-start</a>]: Failed to
initialize storage module: user (path: C:\...\Temp\php\session) in
D\...\phpMyAdmin\libraries\session.inc.php on line 86

I set up the config file by hand, then tried to run phpMyAdmin and got
the same error.

I searched for references to the error message on php.net and found a
bug report from which I gather that the cause is actually a PHP bug.
(See the reference to phpMyAdmin in the last message on the page.)

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

I searched the phpMyAdmin bug lists and FAQ, but I did not see any
reference to this.

There must be a workaround for this problem -- if not, phpMyAdmin
would be dead in the water for some significant fraction of users.
Can anyone tell me what it is, or where to look?

The configuration is: OS, Windows XP SP2; Apache, v.2.2.8; PHP,
v.5.2.5; MySQL, v.5.0.51; phpMyAdmin, v.2.11.4.
Jerry Stuckle

2008-02-21, 4:05 am

Jonathan Sachs wrote:
> I just tried to install phpMyAdmin on my system, and I can't get it to
> work. When I tried to run the setup procedure (setup.php) I got the
> following message:
>
> Fatal error: session_start() [<a
> href='function.session-start'>function.session-start</a>]: Failed to
> initialize storage module: user (path: C:\...\Temp\php\session) in
> D\...\phpMyAdmin\libraries\session.inc.php on line 86
>
> I set up the config file by hand, then tried to run phpMyAdmin and got
> the same error.
>
> I searched for references to the error message on php.net and found a
> bug report from which I gather that the cause is actually a PHP bug.
> (See the reference to phpMyAdmin in the last message on the page.)
>
> http://bugs.php.net/bug.php?id=32330
>
> I searched the phpMyAdmin bug lists and FAQ, but I did not see any
> reference to this.
>
> There must be a workaround for this problem -- if not, phpMyAdmin
> would be dead in the water for some significant fraction of users.
> Can anyone tell me what it is, or where to look?
>
> The configuration is: OS, Windows XP SP2; Apache, v.2.2.8; PHP,
> v.5.2.5; MySQL, v.5.0.51; phpMyAdmin, v.2.11.4.
>


Sounds like you have a problem with your php.ini file. What do you have
for your session_save_path and session_save_handler?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Rik Wasmus

2008-02-21, 4:05 am

On Thu, 21 Feb 2008 04:54:03 +0100, Jonathan Sachs =

<js070717@sbcglobal.net> wrote:

> I just tried to install phpMyAdmin on my system, and I can't get it to=


> work. When I tried to run the setup procedure (setup.php) I got the
> following message:
>
> Fatal error: session_start() [<a
> href=3D'function.session-start'>function.session-start</a>]: Failed to=


> initialize storage module: user (path: C:\...\Temp\php\session) in
> D\...\phpMyAdmin\libraries\session.inc.php on line 86
>
> I set up the config file by hand, then tried to run phpMyAdmin and got=


> the same error.
>
> I searched for references to the error message on php.net and found a
> bug report from which I gather that the cause is actually a PHP bug.
> (See the reference to phpMyAdmin in the last message on the page.)
>
> http://bugs.php.net/bug.php?id=3D32330


PHPMyAdmin doesn't destroy sessions by default, I don't think this bug i=
s =

relevant.

THe only problem I had a while back on Windows was that the path =

('C:\...\Temp\php\session') did not exist. After creating it (easier the=
n =

to figure out where to set it) no more problems.
-- =

Rik Wasmus
AnrDaemon

2008-02-21, 4:05 am

Greetings, Jonathan Sachs.
In reply to Your message dated Thursday, February 21, 2008, 06:54:03,

> I just tried to install phpMyAdmin on my system, and I can't get it to
> work. When I tried to run the setup procedure (setup.php) I got the
> following message:


> Fatal error: session_start() [<a
> href='function.session-start'>function.session-start</a>]: Failed to
> initialize storage module: user (path: C:\...\Temp\php\session) in


Why the hell You use "user" storage?

> D\...\phpMyAdmin\libraries\session.inc.php on line 86


> I set up the config file by hand, then tried to run phpMyAdmin and got
> the same error.


> I searched for references to the error message on php.net and found a
> bug report from which I gather that the cause is actually a PHP bug.
> (See the reference to phpMyAdmin in the last message on the page.)


> http://bugs.php.net/bug.php?id=32330


> I searched the phpMyAdmin bug lists and FAQ, but I did not see any
> reference to this.


> There must be a workaround for this problem -- if not, phpMyAdmin
> would be dead in the water for some significant fraction of users.
> Can anyone tell me what it is, or where to look?


> The configuration is: OS, Windows XP SP2; Apache, v.2.2.8; PHP,
> v.5.2.5; MySQL, v.5.0.51; phpMyAdmin, v.2.11.4.




--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

Jonathan Sachs

2008-02-21, 8:03 am

On Thu, 21 Feb 2008 05:17:24 +0100, "Rik Wasmus"
<luiheidsgoeroe@hotmail.com> wrote:

>THe only problem I had a while back on Windows was that the path
>('C:\...\Temp\php\session') did not exist. After creating it (easier then
>to figure out where to set it) no more problems.


That's a constructive suggestion -- unfortunately, it's not the
problem here. That path does exist on my system.
Jonathan Sachs

2008-02-21, 7:03 pm

On Thu, 21 Feb 2008 08:38:28 +0300, AnrDaemon <anrdaemon@freemail.ru>
wrote:

>
>Why the hell You use "user" storage?


If you think about it, the answer should be obvious: I did not do any
such thing. All I did was install a widely used and respected
application on my computer. Its use of directories is determined by
its creators. If you have to swear at somebody, swear at them.

I'd like to see if we can salvage something useful from your post. Is
there reason to believe that moving the directory will help? If so,
is there a way to do it without going in and mucking with the code? I
think that would be far more likely to complicate the problem than
solve it.
Jonathan Sachs

2008-02-21, 7:03 pm

I just discovered something odd which may be be related to this
problem.

The PHP book I am reading says that MySQL recommends downloading and
installing the latest PHP connectors, mysql.dll and mysqli.dll, and it
gives instructions for doing so. The reason it gives is that the
MySQL site's connectors will always be current, while those downloaded
with a PHP distribution may be a few ws old.

I thought I'd do this to eliminate old connectors as a possible cause
of the phpMyAdmin problem, but I found that:

1. Only the mysql connector was installed with PHP -- mysqli was not.

2. The mysql connector was version 5.0.45, and my MySQL (the latest
stable version, as of a few ws ago) is 5.0.51a.

3. The latest mysql and mysqli connectors on the MySQL web site are
even older than the mysql connector from the PHP distribution --
5.0.27. This conflicts with what the book advised me, and is rather
surprising!

I'd like to ask for advice before I start trying various combinations
of connectors more or less at random. Is this situation likely to be
related to my phpMyAdmin problem? If so, what is a good strategy for
cleaning it up?
Rik Wasmus

2008-02-21, 7:03 pm

On Thu, 21 Feb 2008 16:54:31 +0100, Jonathan Sachs
<js070717@sbcglobal.net> wrote:

> I just discovered something odd which may be be related to this
> problem.
>
> The PHP book I am reading says that MySQL recommends downloading and
> installing the latest PHP connectors, mysql.dll and mysqli.dll, and it
> gives instructions for doing so. The reason it gives is that the
> MySQL site's connectors will always be current, while those downloaded
> with a PHP distribution may be a few ws old.
>
> I thought I'd do this to eliminate old connectors as a possible cause
> of the phpMyAdmin problem,


Nope, afaik, the starting/reading/writing of a session in PHPMyAdmin has
nothing to do with database access.

> but I found that:
> 1. Only the mysql connector was installed with PHP -- mysqli was not.


Pretty standard on 'older' setups, PHPMyAdmin requires only one of the
two, not necessarily both

> 2. The mysql connector was version 5.0.45, and my MySQL (the latest
> stable version, as of a few ws ago) is 5.0.51a.
>
> 3. The latest mysql and mysqli connectors on the MySQL web site are
> even older than the mysql connector from the PHP distribution --
> 5.0.27. This conflicts with what the book advised me, and is rather
> surprising!
>
> I'd like to ask for advice before I start trying various combinations
> of connectors more or less at random. Is this situation likely to be
> related to my phpMyAdmin problem?


About 99% sure it is totally unrelated, and the version of your dll's is
probably not even a problem at all.

Most likely there's still something wrong with the session managment at a
whole. What if you try to use sessions in a simple test page, and what
does a phpinfo() tell you about the session settings. Is the directory for
sessions writeable for instance?
--
Rik Wasmus
Jerry Stuckle

2008-02-21, 7:03 pm

Jonathan Sachs wrote:
> On Thu, 21 Feb 2008 08:38:28 +0300, AnrDaemon <anrdaemon@freemail.ru>
> wrote:
>
>
> If you think about it, the answer should be obvious: I did not do any
> such thing. All I did was install a widely used and respected
> application on my computer. Its use of directories is determined by
> its creators. If you have to swear at somebody, swear at them.
>
> I'd like to see if we can salvage something useful from your post. Is
> there reason to believe that moving the directory will help? If so,
> is there a way to do it without going in and mucking with the code? I
> think that would be far more likely to complicate the problem than
> solve it.
>


That's not all you did. To quote you: "I set up the config file by
hand..."

Again, what do you have in your php.ini file for session_save_path and
session_save_handler?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Jonathan Sachs

2008-02-21, 7:03 pm

On Thu, 21 Feb 2008 18:32:46 +0100, "Rik Wasmus"
<luiheidsgoeroe@hotmail.com> wrote:

>Most likely there's still something wrong with the session managment at a
>whole. What if you try to use sessions in a simple test page, and what
>does a phpinfo() tell you about the session settings. Is the directory for
>sessions writeable for instance?


I am just beginning to study the chapter on sessions in my PHP book,
so I'm not in a position to answer the whole question yet. I'm
reproducing the session info from phpinfo() below. If that doesn't
move us forward I'll respond to the first part of the question in
another day or two.

Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter no value no value
session.cookie_domain no value no value
session.cookie_httponly Off Off
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 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler user user
session. save_path C:\DOCUME~1\JONATH~1\LOCALS~1\
Temp\php\session

C:\DOCUME~1\JONATH~1\LOCALS~1\Temp\php\s
ession
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0

Jerry Stuckle

2008-02-21, 7:03 pm

Jonathan Sachs wrote:
> On Thu, 21 Feb 2008 18:32:46 +0100, "Rik Wasmus"
> <luiheidsgoeroe@hotmail.com> wrote:
>
>
> I am just beginning to study the chapter on sessions in my PHP book,
> so I'm not in a position to answer the whole question yet. I'm
> reproducing the session info from phpinfo() below. If that doesn't
> move us forward I'll respond to the first part of the question in
> another day or two.
>
> Session Support enabled
> Registered save handlers files user
> Registered serializer handlers php php_binary wddx
>
> Directive Local Value Master Value
> session.auto_start Off Off
> session.bug_compat_42 Off Off
> session.bug_compat_warn On On
> session.cache_expire 180 180
> session.cache_limiter no value no value
> session.cookie_domain no value no value
> session.cookie_httponly Off Off
> 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 1000 1000
> session.gc_maxlifetime 1440 1440
> session.gc_probability 1 1
> session.hash_bits_per_character 5 5
> session.hash_function 0 0
> session.name PHPSESSID PHPSESSID
> session.referer_check no value no value
> session.save_handler user user
> session. save_path C:\DOCUME~1\JONATH~1\LOCALS~1\
Temp\php\session
>
> C:\DOCUME~1\JONATH~1\LOCALS~1\Temp\php\s
ession
> session.serialize_handler php php
> session.use_cookies On On
> session.use_only_cookies Off Off
> session.use_trans_sid 0 0
>
>


Jonathan,

Try

session.save_path C:/DOCUME~1/JONATH~1/LOCALS~1/Temp/php/session

And ensure your webserver user has full access to the directory (read,
write, etc.)

Also, session.save_handler should be files, not user.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

AnrDaemon

2008-02-22, 4:04 am

Greetings, Jonathan Sachs.
In reply to Your message dated Thursday, February 21, 2008, 17:07:25,

> On Thu, 21 Feb 2008 08:38:28 +0300, AnrDaemon <anrdaemon@freemail.ru>
> wrote:


[color=darkred]
> If you think about it, the answer should be obvious:
> I did not do any such thing.


Just changed settings without actual undestanding of what Your changes means...

Change session.save_handler back to the default "files" and all should work.

> All I did was install a widely used and respected
> application on my computer. Its use of directories is determined by
> its creators. If you have to swear at somebody, swear at them.


> I'd like to see if we can salvage something useful from your post.


It's clear: You have wrong setting and I leave it as a homework for You to
discover why this setting is wrong and what it should be to have Your setup
working properly. But instead of applying head to the question, You applied an
ass and produce some flame about something unrelated to my post.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

jonbuoy@theseegertfamily.org

2008-02-27, 7:02 pm

On Feb 20, 10:54 pm, Jonathan Sachs <js070...@sbcglobal.net> wrote:
> I just tried to install phpMyAdmin on my system, and I can't get it to
> work. When I tried to run the setup procedure (setup.php) I got the
> following message:
>
> Fatal error: session_start() [<a
> href='function.session-start'>function.session-start</a>]: Failed to
> initialize storage module: user (path: C:\...\Temp\php\session) in
> D\...\phpMyAdmin\libraries\session.inc.php on line 86
>
> I set up the config file by hand, then tried to run phpMyAdmin and got
> the same error.
>
> I searched for references to the error message on php.net and found a
> bug report from which I gather that the cause is actually a PHP bug.
> (See the reference to phpMyAdmin in the last message on the page.)
>
> http://bugs.php.net/bug.php?id=32330
>
> I searched the phpMyAdmin bug lists and FAQ, but I did not see any
> reference to this.
>
> There must be a workaround for this problem -- if not, phpMyAdmin
> would be dead in the water for some significant fraction of users.
> Can anyone tell me what it is, or where to look?
>
> The configuration is: OS, Windows XP SP2; Apache, v.2.2.8; PHP,
> v.5.2.5; MySQL, v.5.0.51; phpMyAdmin, v.2.11.4.


On Feb 20, 10:54 pm, Jonathan Sachs <js070...@sbcglobal.net> wrote:
> I just tried to install phpMyAdmin on my system, and I can't get it to
> work. When I tried to run the setup procedure (setup.php) I got the
> following message:
>
> Fatal error: session_start() [<a
> href='function.session-start'>function.session-start</a>]: Failed to
> initialize storage module: user (path: C:\...\Temp\php\session) in
> D\...\phpMyAdmin\libraries\session.inc.php on line 86
>
> I set up the config file by hand, then tried to run phpMyAdmin and got
> the same error.
>
> I searched for references to the error message on php.net and found a
> bug report from which I gather that the cause is actually a PHP bug.
> (See the reference to phpMyAdmin in the last message on the page.)
>
> http://bugs.php.net/bug.php?id=32330
>
> I searched the phpMyAdmin bug lists and FAQ, but I did not see any
> reference to this.
>
> There must be a workaround for this problem -- if not, phpMyAdmin
> would be dead in the water for some significant fraction of users.
> Can anyone tell me what it is, or where to look?
>
> The configuration is: OS, Windows XP SP2; Apache, v.2.2.8; PHP,
> v.5.2.5; MySQL, v.5.0.51; phpMyAdmin, v.2.11.4.


Well since everyone else seems to be so pissy about this I'll give you
my work around...

I just upped to v2.11.4 and forgot all about this "bug" and had to
figure it all out again. Somewhere along the lines phpMyAdmin began
"assuming" that the session variables in php.ini are set up as the
default "user" value. I, like many others I know, use my own session
management routines for all of my scripts - i.e. my
session.save_handler is set to "user" and not to "files" because IT
SUITS ME TO DO SO and not because some self-righteous schmuck has
decided that thats the way it should be.

I would agree with anyone that a well written program would by
definition not assume that every externally supplied script is written
like mine and so should override local settings (if possible) for
those critical things like sessions. Below is a snippet of code that
I have had to insert in several open-source pieces of code (things
like blogging scripts, phorums, and now phpmyadmin). There are
consequences to this you should explore, but if you're running
phpmyadmin on your home devel workstation, then the consequences are,
well, inconsequential.

insert everything below into the ./libraries/session.inc.php script
located off of the root of your phpmyadmin home directory. I would
insert it just above the phpmyadmin-provided section titled "//
session cookie settings":

// override any user settings in the php.ini file and set the
// session type to file instead of "user". In particular,
// some systems are have this set to "user" when all of their
// major script components use a custome user set of session
// management routines.
ini_set('session.save_handler', 'files');

If you insert that and just relaunch phpmyadmin you'll get past the
error you reported, AND your existing code won't be busted because you
changed an .ini setting you made assumptions on in other pieces of
code that work. I would also stress that the value of
session.save_path value in the php.ini file MUST point to a valid
directory and must be accessable for read/write.

- Jonbuoy

"Life should not be a journey to the grave with the intention of
arriving safely in a pretty and well preserved body, but rather to
skid in broadside, in a cloud of smoke, thoroughly used up, totally
worn out, and loudly proclaiming, 'Wow! What a Ride!'" - Hunter S.
Thompson
Jonathan Sachs

2008-02-27, 7:02 pm

Thank you for the positive input. As it happens, I solved the problem
myself several days ago -- not hard once I figured out what was
actually wrong. For obvious reasons, I was not tempted to announce
the event.

My approach was philosophically different than yours, since my
interests are different. I used Apache's <Directory> directive to set
session.save_handler properly for phpMyAdmin without changing the
default that is required by (and was set by) the application which is
my main reason for working with PHP.

My sense of this forum is that most of the residents are decent sorts,
but the tone is set by a few who like to make themselves feel big by
belittling anyone who knows less about their favorite subject than
they do. Given that, I don't think it is going to be a useful place
to hang out. Should I need more assistance with PHP, I will probably
look elsewhere.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com