Skip site navigation (1) Skip section navigation (2)

Re: pg_connect error

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-php(at)postgresql(dot)org
Cc: "LonLinux" <longlinux(at)gmail(dot)com>
Subject: Re: pg_connect error
Date: 2008-05-19 01:40:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-php
On Sunday 18 May 2008 16:21:15 LonLinux wrote:
> Hello, I have this problem with a connection to postgres server (running in
> a win2000 server). When I connect with pgAdmin to the same postgres server
> works ok, but when I try to connect from php5 the connection fails. Can
> help me?
> Thanks.
> $db_conn = pg_connect("host=SQLMACHINE port=5432 password=xxxx
> user=postgres dbname=compraventa1"); if (!$db_conn): ?>
>     <H1>Failed connecting to postgres database <? echo "compraventa1"
> ?></H1> <? exit;
> endif;

Well, what's the error message? (And if there isnt one, have you looked in the 
db logs? If nothing there, try connecting with psql with the same credentials 
as above, as your web servers user)

Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

In response to

pgsql-php by date

Next:From: ChrisDate: 2008-05-19 01:42:45
Subject: Re: pg_connect error
Previous:From: LonLinuxDate: 2008-05-18 20:21:15
Subject: pg_connect error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group