I'm trying to install Roundcube on a CentOS 5.5 server, with a PostgreSQL 8.1.22 database.
The first page of the installer script, that checks for the presence of php libraries and such, gives me green OKs across the board. I even went out of my way to install the optional ones.
Page two generates me two configuration files (main.inc.php and db.inc.php) which I put into place.
Page three is where things go wrong:
Check DB config DSN (write): NOT OK(MDB2 Error: connect failed)
Make sure that the configured database exists and that the user has write privileges
DSN: pgsql://roundcube:password@localhost/roundcubemail
The info you see there (user roundcube, password password, server localhost and database roundcubemail) is all correct. The database roundcubemail belongs to the user roundcube and it has write permissions.
I have no clue why it can't connect to that database. I'm managing it with phpPgAdmin, which is running on the very same Apache, on the same server!
update
some more information:
my postgres log file has a bunch of these:
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "roundcube", database "roundcubemail", SSL off
however, my pg_hba.conf file has this:
# "local" is for Unix domain socket connections only
local all all trust
host all all 127.0.0.1/32 trust
Using telnet to connect to both localhost and 127.0.0.1 on port 5432 works fine.
The answer from DerfK above is wrong. You can use PostgreSQL using Unix socket with roundcube provided you're configuring it well. In the db.inc.php, it should read:
Provided you've created a "roundcube" user in pgsql for the database "roundcube" with password "password" In your main postgresql.conf, you should prevent listening on the IP layer, by changing:
Also, and that is the most important part, you must change in pg_hba.conf to add this line:
Restart everything, and it's working perfectly well and faster than using TCP connections (since you avoid all the IP encapsulation).