Users login has wrong database connection info

James Orr
2014-01-07
2014-01-07
  • James Orr
    James Orr
    2014-01-07

    My mysql database is not on the same server as apache. I have dbconfig.inc.php setup correctly and the admin login works perfectly.

    However, when I attempt to use the users login (/postfixadmin/users/), I get ...

    DEBUG INFORMATION:
    Connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    Obviously, it should not be attempting to connect through a socket at all.

    So, why is it not using the same database connection settings, and how can I make it do so?

     
  • dbconfig.inc.php sounds like you are using the debian package, right?

    Your config.inc.php should have the following:

    // This loads the automatic generated DB credentials from /etc/postfixadmin/dbconfig.inc.php
    require_once('dbconfig.inc.php');
    

    Change it to

    require_once(dirname(__FILE__) . '/dbconfig.inc.php');
    

    Does this fix the problem?

     
  • James Orr
    James Orr
    2014-01-07

    It didn't, in fact that made it stop working on the admin login too.

    I just removed the require_once and replaced it with the contents of the file, now it works in both locations.

     
  • Besides breaking the admin login, did it change something for the user login? (I'm asking to make sure you are changing a file that is actually used at user login ;-)

    Your solution sounds more than a workaround to me, but unfortunately I don't know the details of the deb package, which also means I can't suggest "the solution"[tm].

    @David and Norman: any idea what happens here?

     
    • James Orr
      James Orr
      2014-01-07

      No, nothing changed on the user login and admin login broke with the same error it was giving for user login.