being new to php and pgsql i was hoping somone could help with this:
utilizing the string:
pg_connect("dbname=test1");
i get the error saying that user apache cannot connect to database
changing it to:
pg_connect("dbname=test1 user=user1")
i get the error saying that authentication failed for user user1
but the kicker is that i can su - user1 from root and psql just fine to the databases and do any query.
any advice or ideas on where to go next?
thanx
sean
pg_connect cannot connect to pgsql db
Moderator: General Moderators
when using su you probably provide a password for that account but you don't in your connect string.
http://www.php.net/manual/en/function.pg-connect.php
http://www.php.net/manual/en/function.pg-connect.php
$dbconn3 = pg_connect ("host=sheep port=5432 dbname=mary user=lamb password=foo");
i guess i should have added that. i tested it and no luck. i did find the possible problem i need to enter in pg_hba.conf to allow the internet users.
any idea on how to allow any ipaddress to have access? since i am utilizing php, would i actually have the ip address of my server be added since the scripts are run from there?
thanx for the reply!!
sean
any idea on how to allow any ipaddress to have access? since i am utilizing php, would i actually have the ip address of my server be added since the scripts are run from there?
thanx for the reply!!
sean