Postgres access problem /white screen

Postgres access problem /white screen

by Werner Arnhold -
Number of replies: 2
Hello,
yesterday I downloaded version 1.4.2+ and unpacked it on a SuSE Linux 9.1, using PostgreSQL 7.3.2 and Apache2. I followed the installation instruction that came with the downloaded version until the point where to enter the ../admin/index.php. I got a white screen. I inserted some echoes and traced the problem back to lib/setup.php file where the connection to the database is made. When I entered lib/adodb/adodb.inc.php I found out, that the line

if ($this->_connect($this->host, $this->user, $this->password, $this->database)) return true;

failed and the program did not return from the call

$err = $this->ErrorMsg();

I am not a PHP-programmer so I need help. I have a moodleuser who is able to connect to the database "moodle" with the psql utility.

What can I do next?

Thanks in advance

Werner
Average of ratings: -
In reply to Werner Arnhold

Re: Postgres access problem /white screen

by Penny Leach -
Normally if moodle can't connect to the database, it tells you.

Take a look at the postgres logs - it should have an error about access that would give more information.

In pg_hba.conf you need to make sure you have the correct settings for moodle to connect to the database. The person connecting with psql may have different access rights, like, it could be trusting that user. (auth method sameuser).

Take a look at the example lines in pg_hba.conf and make sure you're allowing your moodle user to connect to your moodle database with md5 auth method.

Also! Apparently postgres will apply the rules in pg_hba.conf in a very annoying way - if it finds a rule that matches starting from the top, it will STOP after that. So if that method fails, even if you have a rule that works later, authentication will fail.

My rule that allows moodle to connect to postgres looks like this:

 
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host moodle moodle 192.168.2.60 255.255.255.255 md5


You may have a rule that allows your user who is using psql to connect that looks like this:

 
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all whoever ident sameuser


Which doesn't translate into meaning that moodle can connect to postgres.

Good luck!
Penny
In reply to Werner Arnhold

Re: Postgres access problem /white screen

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Hi!

maybe you could try to change line 32 in lib/setup.php:
error_reporting(0); // Hide errors
to:
error_reporting(E_ALL); // Hide errors

You may then see some error messages...

skodak