From egb@tonesoft.com Wed Sep 3 17:36:48 2003 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 02683D1B56B for ; Wed, 3 Sep 2003 17:36:48 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 23305-08 for ; Wed, 3 Sep 2003 14:36:16 -0300 (ADT) Received: from inet0.tonesoft.com (mail.tonesoft.com [12.9.200.149]) by svr1.postgresql.org (Postfix) with ESMTP id 604F1D1B574 for ; Wed, 3 Sep 2003 14:36:15 -0300 (ADT) Received: from VALUED1171C649 ([192.168.2.245]) by inet0.tonesoft.com (8.12.9/8.12.9) with SMTP id h83HaEqt008785 for ; Wed, 3 Sep 2003 10:36:14 -0700 (PDT) From: "Edric Bulalacao" To: Subject: pg_connect problem Date: Wed, 3 Sep 2003 10:36:14 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001A_01C37207.331F6960" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/5 X-Sequence-Number: 2282 This is a multi-part message in MIME format. ------=_NextPart_000_001A_01C37207.331F6960 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit I’m a PHP/PostGRE newbie. I’m getting this error: Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host localhost and accepting TCP/IP connections on port 5432? . in /export/home/tsc/a/delete-action.phtml on line 156 Couldn't make a connection! This is the code I’m trying to run: $connection = pg_connect("host=localhost dbname=address user=address password=address"); This is my pg_hba.conf local all all password This is the output of “netstat –an | grep 5432” unix 2 [ ACC ] STREAM LISTENING 27649 /tmp/.s.PGSQL.5432 I’m able to do “psql –u address” and supply and username and password as any Unix user defined in the system. Can anyone tell me what I’m doing wrong? Thanks. ------=_NextPart_000_001A_01C37207.331F6960 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

I’m a PHP/PostGRE newbie.&nb= sp; I’m getting this error:

 <= /span>

W= arning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host localhost and accepting TCP/IP connections on port 5432? . in /export/home/tsc/a/delete-action.phtml on line 156
Couldn't make a connection!
<= span style=3D'font-family:Arial;color:black;mso-color-alt:windowtext'>

=  

= This is the code I’m trying to= run:

= $connection =3D pg_connect("host=3Dlocalhost dbname=3Daddress user=3Daddress password= =3Daddress");

=  

= This is my pg_hba.conf=

= local  all      all           &nbs= p; password

=  

= This is the output of “netstat= –an | grep 5432”

= unix      [ ACC ]     STREAM     LISTENING     27649  /tmp/.s.PGSQL.5= 432

=  

= I’m able to do “psql = 211;u address” and supply and username and password as any Unix user defined in the system.

=  

=  

= Can anyone tell me what I’m do= ing wrong?  Thanks.=

=  

------=_NextPart_000_001A_01C37207.331F6960-- From nzegarra@kolareal.net Wed Sep 3 17:59:12 2003 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 22A16D1B95D for ; Wed, 3 Sep 2003 17:59:12 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 27580-05 for ; Wed, 3 Sep 2003 14:58:42 -0300 (ADT) Received: from mail.kolareal.net (unknown [200.48.62.162]) by svr1.postgresql.org (Postfix) with ESMTP id A74DBD1B8E0 for ; Wed, 3 Sep 2003 14:58:23 -0300 (ADT) Received: from mail.kolareal.net (localhost.localdomain [127.0.0.1]) by mail.kolareal.net (8.12.8/8.12.8) with ESMTP id h83I0LnS017305 for ; Wed, 3 Sep 2003 13:00:22 -0500 Received: (from apache@localhost) by mail.kolareal.net (8.12.8/8.12.8/Submit) id h83I0LsU017303; Wed, 3 Sep 2003 13:00:21 -0500 X-Authentication-Warning: mail.kolareal.net: apache set sender to nzegarra@kolareal.net using -f Received: from 200.48.62.162 (proxying for 192.168.1.16) (SquirrelMail authenticated user nzegarra) by mail.kolareal.net with HTTP; Wed, 3 Sep 2003 13:00:21 -0500 (PET) Message-ID: <54128.200.48.62.162.1062612021.squirrel@mail.kolareal.net> In-Reply-To: References: Date: Wed, 3 Sep 2003 13:00:21 -0500 (PET) Subject: Re: pg_connect problem From: nzegarra@kolareal.net To: pgsql-php@postgresql.org User-Agent: SquirrelMail/1.4.1-2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/6 X-Sequence-Number: 2283 in your pg_hba.conf must set a line with the follow: local all all 127.0.0.1 255.255.255.255 trust local all all IP.OF.YOUR.MACHINE YOUR.GATEWAY trust and in your postgresql.conf must set the port = 5432 without the comment restart the postgresql and it must work Regards Nilson > I’m a PHP/PostGRE newbie. I’m getting this error: > > Warning: pg_connect(): Unable to connect to PostgreSQL server: could not > connect to server: Connection refused Is the server running on host > localhost and accepting TCP/IP connections on port 5432? . in > /export/home/tsc/a/delete-action.phtml on line 156 > Couldn't make a connection! > > This is the code I’m trying to run: > $connection = pg_connect("host=localhost dbname=address user=address > password=address"); > > This is my pg_hba.conf > local all all password > > This is the output of “netstat –an | grep 5432” > unix 2 [ ACC ] STREAM LISTENING 27649 > /tmp/.s.PGSQL.5432 > > I’m able to do “psql –u address” and supply and username and password as > any > Unix user defined in the system. > > > Can anyone tell me what I’m doing wrong? Thanks. > > From rrussell@commandprompt.com Wed Sep 3 18:00:54 2003 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EFC4BD1B95D for ; Wed, 3 Sep 2003 18:00:54 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 27203-05 for ; Wed, 3 Sep 2003 15:00:45 -0300 (ADT) Received: from hosting.commandprompt.com (214.commandprompt.com [207.173.200.214]) by svr1.postgresql.org (Postfix) with ESMTP id 2BC1ED1B8C9 for ; Wed, 3 Sep 2003 15:00:43 -0300 (ADT) Received: from commandprompt.com (dsl093-077-251.sea2.dsl.speakeasy.net [66.93.77.251]) (authenticated) by hosting.commandprompt.com (8.11.6/8.11.6) with ESMTP id h83I0hC29826 for ; Wed, 3 Sep 2003 11:00:43 -0700 Message-ID: <3F562C48.1020404@commandprompt.com> Date: Wed, 03 Sep 2003 11:00:40 -0700 From: Robby Russell Organization: Command Prompt, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030727 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-php@postgresql.org Subject: Re: pg_connect problem References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/7 X-Sequence-Number: 2284 Edric Bulalacao wrote: > Thank you for the quick reply. Looks like all the lines in my > postgresql.conf file are all commented out. > > I will uncomment the tcpip_socket and port lines lines to see if it works: > > No problem. I've run into this on several occasions when I'm setting up a new server and forget to make that one minor little change. It's a good default security setting, however it adds one extra little step for us. heh -Robby > # Connection Parameters > # > #tcpip_socket = true > #ssl = false > > #max_connections = 32 > #superuser_reserved_connections = 2 > > #port = 5432 > #hostname_lookup = false > #show_source_port = false > > > > -----Original Message----- > From: Robby Russell [mailto:rrussell@commandprompt.com] > Sent: Wednesday, September 03, 2003 10:48 AM > To: Edric Bulalacao > Subject: Re: [PHP] pg_connect problem > > Edric Bulalacao wrote: > >>I'm a PHP/PostGRE newbie. I'm getting this error: >> >>Warning: pg_connect(): Unable to connect to PostgreSQL server: could not >>connect to server: Connection refused Is the server running on host >>localhost and accepting TCP/IP connections on port 5432? . in >>/export/home/tsc/a/delete-action.phtml on line 156 >>Couldn't make a connection! > > >>Can anyone tell me what I'm doing wrong? Thanks. > > > Look at your postgres.conf file. > > Is TCP/IP on? > > tcpip_socket = true > > > > -- > Robby Russell, | Sr. Administrator / Lead Programmer > Command Prompt, Inc. | http://www.commandprompt.com > rrussell@commandprompt.com | Telephone: (503) 222.2783