Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 03F116330F3 for ; Mon, 1 Feb 2010 20:55:07 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 20158-07 for ; Tue, 2 Feb 2010 00:54:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f222.google.com (mail-ew0-f222.google.com [209.85.219.222]) by mail.postgresql.org (Postfix) with ESMTP id AC96A632F56 for ; Mon, 1 Feb 2010 20:54:55 -0400 (AST) Received: by ewy22 with SMTP id 22so292480ewy.34 for ; Mon, 01 Feb 2010 16:54:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=035Ic1Z2YCAQgIFcf6H/qhbaL+hplFyEndTO2cOscw4=; b=fDDbG6nirQKlfJWg/x51N/tqKQMniIR1CFlYIpLVjZn2oMpUctQyW/f/oZwtxiFs+k 68lfrvQJNRODof8d/fk4ihLk6m4oP0fv/GmRN0k4Trf0sDObbt4y5hYGVvCTC8XDIKpT 3H43BLLm8ebCL7rkgwFaYBZ8HfxtgiyY2Jac4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Et9AvQwsTRPMQBLqkSm9V6lVL5E7JcoXPP07EcIVr1AJ+RMtIod90xZudPvwdQo8JT RqwSM7UYPUYcxZR0nE/0wbzeYBU9j53ACwgQtDXl22BOnS2fdnfy9KtDKjSBAKSExwhq dEgzpmWT/U4BJJACSNO5GzZOtEfw1zTICICYU= MIME-Version: 1.0 Received: by 10.216.90.203 with SMTP id e53mr3271534wef.28.1265072093140; Mon, 01 Feb 2010 16:54:53 -0800 (PST) In-Reply-To: References: <20100128084415.4d98823a.wmoran@potentialtech.com> <4B62236F.1090200@gmail.com> <4B660281.5060007@gmail.com> <4B676E2D.5060903@gmail.com> From: Gustavo Amarilla Santacruz Date: Mon, 1 Feb 2010 21:54:33 -0300 Message-ID: Subject: Re: Undefined function pg_connect() To: Chris Cc: Bill Moran , pgsql-php@postgresql.org Content-Type: multipart/alternative; boundary=0016e6d7e32dba16c2047e938c81 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.976 tagged_above=-10 required=5 tests=AWL=0.622, BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201002/4 X-Sequence-Number: 4124 --0016e6d7e32dba16c2047e938c81 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am sorry. Please, ommit the previous post. The correct post is the following: Thank you, Chris. The pg_hba.conf file contained this: # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1 255.255.255.0 trust # IPv6 local connections: host all all ::1/128 ident After, i modified it to: # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1 255.255.255.0 trust # IPv6 local connections: host all all ::1/128 trust Then i can login me from php scripts. But, how i Know that apache is using IPV6 connections? On Mon, Feb 1, 2010 at 9:51 PM, Gustavo Amarilla Santacruz < gusamasan@gmail.com> wrote: > Thank you, Chris. > > The pg_hba.conf contained: > > > # TYPE DATABASE USER CIDR-ADDRESS METHOD > > # "local" is for Unix domain socket connections only > local all all trust > # IPv4 local connections: > host all all 127.0.0.1 255.255.255.0 trust > # IPv6 local connections: > host all all ::1/128 ident > > > Before, i modified to: > > > # TYPE DATABASE USER CIDR-ADDRESS METHOD > > # "local" is for Unix domain socket connections only > local all all trust > # IPv4 local connections: > host all all 127.0.0.1 255.255.255.0 trust > # IPv6 local connections: > host all all ::1/128 trust > > > Then i can login me. But, how i Know that apache is using IPV6 connection= s? > > > > On Mon, Feb 1, 2010 at 9:13 PM, Chris wrote: > >> Gustavo Amarilla Santacruz wrote: >> >>> Thank you, all. >>> >>> I had access to the SELinux->Boolean; next, i check the option: >>> >>> "Allow HTTPD scripts and modules to connect to databases over the >>> network". >>> >>> >>> Then, a new message was displayed: >>> >>> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: >>> Ident authentication failed for user "gestock" ....... >>> >>> >>> I can login with gestock data (user/password) through the postgresql ps= ql >>> tool. But from apache i can not. >>> >> >> It's not using the password, it's just checking the username to see if >> you're logged in as 'gestock' (but 'apache' is not 'gestock', hence the >> error). >> >> What does your postgresql pg_hba.conf file look like? >> >> >> -- >> Postgresql & php tutorials >> http://www.designmagick.com/ >> >> > > > -- > Gustavo Amarilla > > =BFReciclaste papel, hoy? > --=20 Gustavo Amarilla =BFReciclaste papel, hoy? --0016e6d7e32dba16c2047e938c81 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am sorry. Please, ommit the previous post.

The correct post is the= following:


Thank you, Chris.

The pg_hba.conf file contained this:
# TYPE=A0 DATABASE=A0= =A0=A0 USER=A0=A0=A0=A0=A0=A0=A0 CIDR-ADDRESS=A0=A0=A0=A0=A0=A0=A0=A0=A0 ME= THOD

# "local" is for Unix domain socket connections only=
local=A0=A0 all=A0=A0= =A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 trust
# IPv4 local connections:
host=A0=A0=A0 all=A0=A0= =A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 127.0.0.1 255.255.255.0 trus= t
# IPv6 local connections:
host=A0=A0=A0 all=A0=A0= =A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 ::1/128=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 ident


After, i modified it to:
<= br># TYPE=A0 DATABASE= =A0=A0=A0 USER=A0=A0=A0=A0=A0=A0=A0 CIDR-ADDRESS=A0=A0=A0=A0=A0=A0=A0=A0=A0= METHOD

# "local" is for Unix domain socket co= nnections only
local=A0=A0 all=A0=A0=A0=A0= =A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 trust
# IPv4 local connection= s:
host=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0= =A0 all=A0=A0=A0=A0=A0=A0=A0=A0 127.0.0.1 255.255.255.0 trust
# IPv6 local connection= s:
host=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0= =A0 all=A0=A0=A0=A0=A0=A0=A0=A0 ::1/128=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 trust


Then i can login me from php scripts. But, how i Know that apache i= s using IPV6 connections?

On Mon, Feb 1, = 2010 at 9:51 PM, Gustavo Amarilla Santacruz <gusamasan@gmail.com> wrote:
Thank you, Chris.=

The pg_hba.conf contained:


# TYPE=A0 DATAB= ASE=A0=A0=A0 USER=A0=A0=A0=A0=A0=A0=A0 CIDR-ADDRESS=A0=A0=A0=A0=A0=A0=A0=A0= =A0 METHOD

# "local" is for Unix domain socket connections only
local= =A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 trust
# IPv4 local connections:
host=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 all= =A0=A0=A0=A0=A0=A0=A0=A0 127.0.0.1 255.255.255.0 trust
# IPv6 local conn= ections:
host=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0= =A0=A0 ::1/128=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ident


<= /div>Before, i modified to:


# TYPE=A0 DATABASE=A0=A0=A0 USER=A0=A0=A0=A0=A0=A0=A0 CIDR-ADDRESS=A0=A0=A0= =A0=A0=A0=A0=A0=A0 METHOD

# "local" is for Unix domain soc= ket connections only
local=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 all=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 trust
# IPv4 local connections:
host=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 127.0= .0.1 255.255.255.0 trust
# IPv6 local connections:
host=A0=A0= =A0 all=A0=A0=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 ::1/128=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 trust


Then i can login me. = But, how i Know that apache is using IPV6 connections?



On Mon, Feb 1, 2010 at 9:13 PM, Chris <= dmagick@gmail.com> wrote:
Gustavo Amarilla Santacruz wrote:
Thank you, all.

I had access to the SELinux->Boolean; next, i check the option:

=A0"Allow HTTPD scripts and modules to connect to databases over the n= etwork".


Then, a new message was displayed:

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident= authentication failed for user "gestock" .......


I can login with gestock data (user/password) through the postgresql psql t= ool. But from apache i can not.

It's not using the password, it's just checking the username to see= if you're logged in as 'gestock' (but 'apache' is not = 'gestock', hence the error).

What does your postgresql pg_hba.conf file look like?
<= br>
--
Postgresql & php tutorials
http://www.desig= nmagick.com/




<= div>
--
Gustavo Amarilla

=BFReciclaste pa= pel, hoy?



--
Gustavo Ama= rilla

=BFReciclaste papel, hoy?
--0016e6d7e32dba16c2047e938c81--