Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 0FFC82E002F for ; Sun, 18 May 2008 22:40:16 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 08576-04 for ; Sun, 18 May 2008 22:40:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vms173003pub.verizon.net (vms173003pub.verizon.net [206.46.173.3]) by developer.postgresql.org (Postfix) with ESMTP id 177012E002C for ; Sun, 18 May 2008 22:40:12 -0300 (ADT) Received: from ridley.home ([72.81.250.230]) by vms173003.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K1300A9PDU7OHBK@vms173003.mailsrvcs.net> for pgsql-php@postgresql.org; Sun, 18 May 2008 20:37:19 -0500 (CDT) Date: Sun, 18 May 2008 21:40:10 -0400 From: Robert Treat Subject: Re: pg_connect error In-reply-to: <001201c8b924$bad26150$e295fea9@osvaldox> To: pgsql-php@postgresql.org Cc: "LonLinux" Message-id: <200805182140.10890.xzilla@users.sourceforge.net> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-15 Content-transfer-encoding: 7bit Content-disposition: inline References: <001201c8b924$bad26150$e295fea9@osvaldox> User-Agent: KMail/1.9.9 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/4 X-Sequence-Number: 3846 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