#2213 (ok 2.8.2.3) Config not loaded on install

2.8.2.1
fixed
Marc Delisle
1
2013-06-11
2006-08-07
Larry Garfield
No

With a fresh install of phpMyAdmin 2.8.2.1, I ran into
a problem where the system wasn't picking up my config
file. It turns out the problem is in
libraries/common.inc.php.

Line 2994, there is this block of code:

if (empty($_SESSION['PMA_Config'])) {
...
$_SESSION['PMA_Config'] = new
PMA_Config('./config.inc.php');

So it only parses the config file if there is no active
session (effectively). Since I'd hit the index.php
page in my browser once before I had the config file
fully setup, there was an active session with the base
config data. Since I couldn't log in, I couldn't log
out to clear the session, so PMA never read my config
file and was always giving me a MySQL #2002 error.
("The server is not responding (or the local MySQL
server's socket is not correctly configured)".)

This wasn't mentioned in the documentation that I could
see, so it took me a while to track it down.
Eventually clearing all cookies in my browser fixed it.

While I agree there is a performance benefit to caching
the config this way, it makes installation notably
trickier. That's especially a problem, I'd think, for
people using an auth method of config or http, since
they have no log out mechanism.

Perhaps some different caching mechanism? Or some
other check for the config file so that it's more
forgiving? As-is, I consider this an installation bug.

Cheers.

Discussion

1 2 > >> (Page 1 of 2)
  • Marc Delisle
    Marc Delisle
    2006-08-10

    Logged In: YES
    user_id=210714

    Can't reproduce your problem. Here is how I test:
    0. Clear all browser cookies
    1. fresh install of 2.8.2.1
    2. access index.php: normal error (and cookie creation)
    3. move config.inc.php to the directory
    4. reload browser: login page displayed (I use cookie auth_type)

     
  • Marc Delisle
    Marc Delisle
    2006-08-10

    • assigned_to: nobody --> lem9
     
  • Jürgen Wind
    Jürgen Wind
    2006-08-10

    Logged In: YES
    user_id=1383652

    in firefox & IE6 (even without cookie deletion!):

    start pma2821 with no config.inc -> err 2003 (mySql on non
    standard port)

    BUT NO MESSAGE, on missing config.inc !

    Then config.inc.php moved to phpMyAdmin/

    a.) http://localhost/phpMyAdmin/ [Enter] -> no success

    b.) hitting "reload" (even without Ctrl) -> success

    may be a hint at "missing config.inc.php" and "reload" after
    installing a config.inc could be helpful in such situation.

     
  • Marc Delisle
    Marc Delisle
    2006-08-11

    Logged In: YES
    user_id=210714

    Juergen,
    I don't see how you can get such results. When I start
    2.8.2.1 without config.inc.php, I get the message "Probably
    reason of this is that you did not create configuration
    file. You might want to use setup script to create one."

    and under it, the
    "Error MySQL said: Documentation
    #1045 - Access denied for user 'root'@'localhost' (using
    password: NO) "

    Any idea why you are getting a 2003 error? After all, the
    libraries/config.default.php is the same for you and me.

     
  • Jürgen Wind
    Jürgen Wind
    2006-08-11

    Logged In: YES
    user_id=1383652

    hi Marc,
    i am forced (and used to, maybe 1% other users too?)
    to run mysql on port 3307.
    but config.default tries to connect to 3306,
    when no config.inc.php is provided.

     
  • Marc Delisle
    Marc Delisle
    2006-08-11

    Logged In: YES
    user_id=210714

    It makes sense now. In libraries/auth/config.auth.lib.php,
    starting at line 110, there are exceptions for errors 2002
    and 2003. These exceptions were there for a reason, but I
    bet they existed before our current config caching.

    Let's think about improving this code.

     
  • Marc Delisle
    Marc Delisle
    2006-08-11

    Logged In: YES
    user_id=210714

    And this will probably justify releasing 2.8.2.2.

     
  • Logged In: YES
    user_id=1080252

    I confirm the problem exists. I have the same problems as
    submitter.

     
  • Marc Delisle
    Marc Delisle
    2006-08-11

    Logged In: YES
    user_id=210714

    The attached config.auth.lib.php in librairies/auth should
    take care of the situation, please test and report.

     
  • Marc Delisle
    Marc Delisle
    2006-08-11

    patched config.auth.lib.php

     
    Attachments
  • Marc Delisle
    Marc Delisle
    2006-08-11

    • summary: Config not loaded on install --> Config not loaded on install (error 2002 or 2003)
     
  • Jürgen Wind
    Jürgen Wind
    2006-08-11

    Logged In: YES
    user_id=1383652

    fixed!
    hint at "not created" & link to "setup script" do appear now.

    (#2003...)

     
  • Jürgen Wind
    Jürgen Wind
    2006-08-11

    Logged In: YES
    user_id=1383652

    in setup.php, after saving canges, this appears:
    ----
    File saved
    Configuration saved to file config/config.inc.php in
    phpMyAdmin top level directory, copy it to top level one and
    delete directory config to use it.
    ----
    i could think of the following addition (also in pma>2.8):
    "(sometimes a forced browser refresh is needed to take effect)"

    or better formulated by someone, who's mother tongue is
    english ;)

     
  • Jürgen Wind
    Jürgen Wind
    2006-08-11

    Logged In: YES
    user_id=1383652

    Marc,

    in server.php create/edit
    (first time i used it ;)

    [ ] Compress connection

    should better be

    Compress connection ...[ ]

    (checkbox aligned with option boxes)

    should i start a new bug or patch ?

     
  • Marc Delisle
    Marc Delisle
    2006-08-11

    Logged In: YES
    user_id=210714

    Juergen,
    - thanks for testing

    - in which case do we need a forced browser refresh?

    - for the option box, please submit a patch

     
  • Jürgen Wind
    Jürgen Wind
    2006-08-11

    Logged In: YES
    user_id=1383652

    >- in which case do we need a forced browser refresh?
    i noticed, when testing in IE6 only
    (internal refresh settings: automatic)
    after moving the new config.inc to '..'.
    At least a refresh can't hurt, but solve some users from
    headaches :)

     
  • Marc Delisle
    Marc Delisle
    2006-08-11

    Logged In: YES
    user_id=210714

    I would appreciate feedback about the included patch from
    lgarfiel and patryk.

     
  • Logged In: YES
    user_id=1080252

    I have text "Probably reason of this is that you did not
    create configuration file. You might want to use setup
    script to create one."

    If I copy config.inc.php into main directory, it picks it up
    without cookie deletion, so I assume patch works.

     
  • Marc Delisle
    Marc Delisle
    2006-08-14

    • status: open --> closed-fixed
     
  • Marc Delisle
    Marc Delisle
    2006-08-14

    Logged In: YES
    user_id=210714

    Thanks. 2.8.2.2 released with the patch.

     
  • Chris
    Chris
    2006-08-14

    Logged In: YES
    user_id=1358251

    I just installed 2.8.2.2 and still had this problem. A
    simple note of "please clear your session cookies, or close
    and restart your browser" would have saved me an hour!
    Suppose if I was a thinking I would have tried that anyway,
    but still....

     
  • Marc Delisle
    Marc Delisle
    2006-08-14

    Logged In: YES
    user_id=210714

    cpn00:
    With 2.8.2.2 you are not supposed to have to clear cookies
    or restart the browser. Please tell me which MySQL error
    message you get.

     
  • Chris
    Chris
    2006-08-14

    Logged In: YES
    user_id=1358251

    I got a mysql 2002.
    Using latest FF 1.5.0.6.

    ..now to fix these hugemongous fonts, which normally are
    nice, but not for database work! :) (I found a thread on
    that so don't worry about the font thing.)

     
  • Marc Delisle
    Marc Delisle
    2006-08-14

    • status: closed-fixed --> open-fixed
     
  • Marc Delisle
    Marc Delisle
    2006-08-14

    Logged In: YES
    user_id=210714

    About the fonts, this is fixed in 2.9.0.

    About the config file, I don't understand why you still have
    this problem. What happens if you rename config.inc.php to
    config.inc.php.other and reload the browser?

     
1 2 > >> (Page 1 of 2)