Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 28275475B0F for ; Tue, 6 Aug 2002 11:09:27 -0400 (EDT) Received: from ryloth.acucore.com (unknown [65.204.194.43]) by postgresql.org (Postfix) with SMTP id 48A0F475820 for ; Tue, 6 Aug 2002 11:09:26 -0400 (EDT) Received: (qmail 1126 invoked by uid 508); 6 Aug 2002 14:17:31 -0000 Received: from killroyboy@users.sourceforge.net by ryloth.acucore.com by uid 505 with qmail-scanner-1.10 (hbedv: 6.13.0.4. hbedv: product: AntiVir. hbedv: operating system: Linux (glibc). hbedv: product version: 2.0.2. hbedv: engine version: 6.13.0.4. hbedv: packlib version: 2.0.0.2 (supports 18 formats). hbedv: vdf version: 6.13.0.21. hbedv: registered user: Dan Wilson, Cedar Hills. hbedv: serial number: 1001019348. hbedv: key expires: 31 May 2003. hbedv: run mode: PRIVATE. spamassassin. Clear:0. Processed in 0.868238 secs); 06 Aug 2002 14:17:31 -0000 Received: from localhost (127.0.0.1) by 0 with SMTP; 6 Aug 2002 14:17:30 -0000 Received: from unk-135-57-86.peoplesoft.com (unk-135-57-86.peoplesoft.com [207.135.57.86]) by webmail.acucore.com (IMP) with HTTP for ; Tue, 6 Aug 2002 08:17:30 -0600 Message-ID: <1028643450.3d4fda7a45740@webmail.acucore.com> Date: Tue, 6 Aug 2002 08:17:30 -0600 From: Dan Wilson To: Riyaz@umapinc.com Cc: pgsql-php@postgresql.org Subject: Re: connecting To PostgreSQL - Getting Error References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.0-cvs X-Priority: 3 (Normal) X-Spam-Status: No, hits=-2.3 required=5.0 tests=IN_REP_TO,MSG_ID_ADDED_BY_MTA_3,AWL version=2.31 X-Spam-Level: X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/15 X-Sequence-Number: 1360 That port is not standard. Are you sure that is the correct port to connect with? Also, make sure you are using the tcpip_socket. Check your postgresql.conf file and uncomment and turn on the tcpip_socket option. Your other option is to just connect using the local socket (which is more secure anyway). You can do this by just leaving of the host option in your connection string. -Dan Quoting Riyaz@umapinc.com: > Hello All, > I am running Postgresql on a linux Qube and trying to connect to it > using PHP. But it is giving me the following error: > > Warning: Unable to connect to PostgreSQL server: connectDB() -- connect() > failed: > Connection refused Is the postmaster running (with -i) at 'localhost' and > accepting connections on TCP/IP port '5583'? in > /home/groups/smarttools/web/testpg2.php on line 21 > > I don't think I am using Unix sockets as I can connect to the database on > psql monitor without -i option and without specifying the port number. > > Any tips on solving this? > > Also in what files are connectDB - - connect() functions stored? > > Thanks, > Riyaz.