X-Original-To: pgsql-php-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8C4669FB387 for ; Mon, 14 Aug 2006 05:47:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 21756-02 for ; Mon, 14 Aug 2006 05:47:06 -0300 (ADT) X-Greylist: delayed 17:20:24.732896 by SQLgrey- Received: from neon.cs.hacettepe.edu.tr (neon.cs.hacettepe.edu.tr [193.140.236.6]) by postgresql.org (Postfix) with ESMTP id 8E8809FB37F for ; Mon, 14 Aug 2006 05:47:05 -0300 (ADT) Received: from neon.cs.hacettepe.edu.tr (neon2.cs.hacettepe.edu.tr [127.0.0.1]) by neon.cs.hacettepe.edu.tr (8.13.1/8.13.1) with ESMTP id k7E8mioi024004; Mon, 14 Aug 2006 11:48:44 +0300 Received: (from apache@localhost) by neon.cs.hacettepe.edu.tr (8.13.1/8.13.1/Submit) id k7E8mhVT024003; Mon, 14 Aug 2006 11:48:43 +0300 From: Fatih Gulec X-Authentication-Warning: neon.cs.hacettepe.edu.tr: apache set sender to fatihg@localhost using -f Received: from 193.140.224.60 (SquirrelMail authenticated user fatihg) by cs.hacettepe.edu.tr with HTTP; Mon, 14 Aug 2006 11:48:43 +0300 (EEST) Message-ID: <2220.193.140.224.60.1155545323.squirrel@cs.hacettepe.edu.tr> In-Reply-To: <44DF7E5B.6070807@mailnetwork.co.uk> References: <2033.193.140.224.60.1155482848.squirrel@cs.hacettepe.edu.tr> <44DF7E5B.6070807@mailnetwork.co.uk> Date: Mon, 14 Aug 2006 11:48:43 +0300 (EEST) Subject: Re: DB Error: connect failed To: "Andy Shellam" Cc: "Fatih Gulec" , pgsql-php@postgresql.org User-Agent: SquirrelMail/1.4.6-5.el4.centos4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV 0.88.2/1655/Sun Aug 13 21:39:20 2006 on neon.cs.hacettepe.edu.tr X-Virus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.908 tagged_above=0 required=5 tests=AWL X-Spam-Level: * X-Archive-Number: 200608/16 X-Sequence-Number: 3587 I solve the problem by the help of Andy. 1. I change SELinux policy of the /tmp [root@bulbul /]# chcon -R -h -t httpd_sys_script_rw_t /tmp 2. I change connection string old : pgsql://postgres:bbmprens@127.0.0.1/prens new : pgsql://postgres:bbmprens@unix(/tmp)/prens Then it works. Thank you so much Andy. > Faith, > > I'm guessing one of 2 things is happening here: > > - PHP is connecting through the Unix socket in /tmp, and permissions are > wrong on the /tmp directory for the Apache user > - Something like TCP wrappers is blocking localhost connections > > Try changing the connection host to the machine's ethernet IP address > instead of 127.0.0.1, this will give you a clue if this is the case. > You could also examine the PostgreSQL logs - I doubt if it would log > this error, but it's worth a shot. > > Andy. > > Fatih Gulec wrote: >> Here is the problem : >> System : Fedora Core 5 >> Application server : Apache (comes with Fedora base installation) >> >> 1. I could not connect to postgresql in php code whicih uses pear packet >> DB. Here is the error code : >> DB Error: connect failed [nativecode=Unable to connect to PostgreSQL >> server: could not connect to server: Permission denied Is the server >> running on host "127.0.0.1" and accepting TCP/IP connections on port >> 5432?] ** pgsql://postgres:bbmprens@127.0.0.1/prens >> >> 2. By the way I can connect that db from an other machine which the >> system >> is Windows XP and program is default PgAdmin. >> 2. Alsa I can connect and use from a windows machine with the sama php >> code that connects to the dbms which works on the Fedora Core 5. >> 3. The user and password are tested by using pgsql command, in command >> prompt. >> >> Thanks... >> >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 1: if posting/reading through Usenet, please send an appropriate >> subscribe-nomail command to majordomo@postgresql.org so that your >> message can get through to the mailing list cleanly >> >> !DSPAM:37,44df4bd2143293352620759! >> >> >> > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match >