Re: How to connect using pg_connect function from php3 ? - Mailing list pgsql-general

From Tatsuo Ishii
Subject Re: How to connect using pg_connect function from php3 ?
Date
Msg-id 20000427102041J.t-ishii@sra.co.jp
Whole thread Raw
In response to How to connect using pg_connect function from php3 ?  ("Luiz Antonio" <luiz@supersoft.com.br>)
List pgsql-general
> Hello list!!!
> I´ve installed the postgresql 6.5.2-2cl.i386.rpm, the postgresql-devel, the
> postgresql-client and postgresql-lib. After, I created the user postmaster
> and the user nobody.
> I did a php3 script using the next line:
> $conn = pg_connect("localhost", "5432", "", "", "ss"),
> but didn´t get to do it work and I had the next warning:
> Warning: Unable to connect to PostgresSQL server: connectDB() -- connect()
> failed:
> Is the postmaster running (with -i) at 'localhost' and accepting connections
> on TCP/IP port '5432'? in
> /home/httpd/html/postgresql/multi.php3 on line 14
>
> Does anybody know how can I do it?
> Do I need to change any name of the last parameters that I am using? Do I
> need to add others?
>
> If somebody could help me...thanks!!!

You need to tweak pg_hba.conf. However if you just want to connect
local PostgreSQL server at 5432 port with the Unix domain socket,

$conn = pg_connect("", "", "ss");

would be enough, for the rather newer PHP (you didn't tell what
version of PHP you are using, though).
--
Tatsuo Ishii

pgsql-general by date:

Previous
From: "Michael S. Kelly"
Date:
Subject: I'm just doin' the 7.0 RC1 install and have some input on the documentation.
Next
From: Ed Loehr
Date:
Subject: Re: Revisited: Transactions, insert unique.