Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 33FCD2E02F5 for ; Mon, 10 Mar 2008 15:38:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 79559-03 for ; Mon, 10 Mar 2008 15:37:51 -0300 (ADT) X-Greylist: delayed 00:59:59.979871 by SQLgrey-1.7.5 Received: from paris.boulder.noaa.gov (paris.boulder.noaa.gov [140.172.10.145]) by postgresql.org (Postfix) with ESMTP id C41362E02F3 for ; Mon, 10 Mar 2008 15:37:53 -0300 (ADT) Received: from lynx.ngdc.noaa.gov (lynx.ngdc.noaa.gov [140.172.179.24]) by email.boulder.noaa.gov (iPlanet Messaging Server 5.2 HotFix 2.01 (built Aug 26 2004)) with ESMTPSA id <0JXI008BFZN37E@email.boulder.noaa.gov> for pgsql-php@postgresql.org; Mon, 10 Mar 2008 17:37:51 +0000 (GMT) Date: Mon, 10 Mar 2008 11:37:51 -0600 From: John Cartwright Subject: pg_connect fails, pgsql works To: pgsql-php@postgresql.org Message-id: <47D571EF.8020408@noaa.gov> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Thunderbird 2.0.0.12 (X11/20080213) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/5 X-Sequence-Number: 3830 Hello All, I'm using php 5.1.6 on a RHEL 5 system connecting to a postgresql server version 8.2.3. I think that TCP connections are enabled correctly in the server's pg_hba.conf and I can successfully connect from the client using pgsql. However, trying to use pg_connect() w/ a call like: $con = pg_connect("host='postgres1.ngdc.noaa.gov' port=5432 sslmode='allow' user='test' password='mypassword' dbname='test'") fails saying: Unable to connect to PostgreSQL server: could not connect to server: Permission denied\n\tIs the server running on host "postgres1.ngdc.noaa.gov" and accepting\n\tTCP/IP connections on port 5432? I'm perplexed since I can connect w/ pgsql from the same workstation using the same database, user, password. Can anyone help me out here? Thanks! -- john