Discussion:
Can not connect with postgres 9.1 database
(too old to reply)
s***@gmail.com
2013-10-15 20:24:37 UTC
Permalink
I have installed Postgresql9.1 in ubuntu. and I wrote a php code to connect with database like below - $db_handle = pg_connect("host=localhost dbname=eschool user=satish password=xxx");

I am able to connect with database ( eschool) using php but when I am trying to run the same php file (phpinfo.php) from my website it is not connecting with database.

form method="POST" action="phpinfo.php" Username: input type="text" name="username" size="15"
Password: input type="password" name="passwort" size="15"
div align="center" input type="submit" value="Login"


I am not sure but my pg_hba.conf looks as below -

#local all postgres peer
local all all md5

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5

Any Idea what's going wrong?
Matt Silverlock
2014-02-09 12:54:09 UTC
Permalink
Check your postgres log.

Loading...