pg_connect error

This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C8B90B.93C020C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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 =3D pg_connect("host=3DSQLMACHINE port=3D5432 password=3Dxxxx =
user=3Dpostgres dbname=3Dcompraventa1");
if (!$db_conn): ?>
<H1>Failed connecting to postgres database <? echo "compraventa1" =
?></H1> <?
exit;
endif;


Ovax
------=_NextPart_000_000F_01C8B90B.93C020C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello, I have this problem with a =
connection to
postgres server (running in a win2000 server).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When I connect with pgAdmin to the same =
postgres
server works ok, but when I try to connect from php5 the connection
fails.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Can help me?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>$db_conn =3D =
pg_connect("host=3DSQLMACHINE port=3D5432
password=3Dxxxx user=3Dpostgres dbname=3Dcompraventa1");<BR>if =
(!$db_conn):
?><BR>    <H1>Failed connecting to postgres =
database
<? echo "compraventa1" ?></H1> =
<?<BR>   
exit;<BR>endif;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Ovax</DIV></FONT></BODY></HTML>

------=_NextPart_000_000F_01C8B90B.93C020C0--
LonLinux [ So, 18 Mai 2008 22:21 ] [ ID #1952750 ]

Re: pg_connect error

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

--
Sent via pgsql-php mailing list (pgsql-php [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
Robert Treat [ Mo, 19 Mai 2008 03:40 ] [ ID #1952826 ]

Re: pg_connect error

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.

What error message do you get?

echo pg_last_error($db_conn);

--
Postgresql & php tutorials
http://www.designmagick.com/

--
Sent via pgsql-php mailing list (pgsql-php [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
dmagick [ Mo, 19 Mai 2008 03:42 ] [ ID #1952827 ]
Datenbanken » gmane.comp.db.postgresql.php » pg_connect error

Vorheriges Thema: Problems connecting (from php to pg)
Nächstes Thema: bytea columns and memory exhaustion