Bug in config.php and solution

  • USB-Linux


    I installed today phpgedview and I had problems with the pdo_mysql. I found a bug and the solution to this one.
    This is the problem:
    in the config.php in line 38 is normaly:  "$DBHOST='localhost'; //- Host where MySQL database is kept" .
    But this leads on some Servers the Error:  "ERROR 2: PDO::__construct()", because the pdo want to have to work.

    After changing the line to  "$DBHOST=''; //- Host where MySQL database is kept"  the System worked.


  • Stephen Arnold
    Stephen Arnold

    Not necessarily a 'bug' but rather that your hosts file has not been configured on your server with the phrase: localhost

    Some prefer this setup as it has been viewed that the use of 'localhost' can be more easily hacked within the HOSTS file and diverted to an external IP, say localhost

    However, the preponderance of configs use the host file for the equivalency of = localhost

    If you choose not to configure it as such, for whatever the reasons (can't, won't), this is easy remedied as you suggested in altering your database host information, as you did. Still, IMHO, I would not necessarily refer to it as a bug.

  • Greg Roach
    Greg Roach

    Out of interest, if your MySQL server is configured to accept direct connections (via a socket), rather than over a network port (, then you can connect directly to the database by specifying a host of just a dot/period "."

    This bypasses the network protocol, and can give slightly better performance.