pg_connect error

pg_connect error

am 18.05.2008 22:21:15 von LonLinux

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): ?>

Failed connecting to postgres database ?>

exit;
endif;


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



charset=3Diso-8859-1">




Hello, I have this problem with a =
connection to=20
postgres server (running in a win2000 server).

When I connect with pgAdmin to the same =
postgres=20
server works ok, but when I try to connect from php5 the connection=20
fails.

Can help me?

Thanks.

 

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

 

Ovax


------=_NextPart_000_000F_01C8B90B.93C020C0--

Re: pg_connect error

am 19.05.2008 03:40:10 von Robert Treat

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): ?>
>

Failed connecting to postgres database > ?>

> 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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Re: pg_connect error

am 19.05.2008 03:42:45 von dmagick

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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php