Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 70BCC635356 for ; Mon, 1 Feb 2010 20:11:48 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 10788-09 for ; Tue, 2 Feb 2010 00:11:37 +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 6D0F06351DF for ; Mon, 1 Feb 2010 20:11:37 -0400 (AST) Received: by ewy22 with SMTP id 22so264192ewy.34 for ; Mon, 01 Feb 2010 16:11:35 -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=grGQ5ATWoHWvDMIruoRmfvTYCKj22HVjrDmotLv1dTA=; b=M/UZNXeAkOuvv+B27GFtAKJGUipd2NvGCBC3VlYaD1YBYGdkMByrhKeIgeceEsh1qe VFfrnYbI1Tcdl5V7t1bSQjsjgAX+h8gfPi+ExgizNeEMNjCXFUpdd2RxOkUMa/njbBLc t7ePy0XD8qBaMyJStamjKNfYLIrfRzyP5JlJo= 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=ftqFcfNmCsjwJYTj1Ysjc3FdQTBB7lZiXsl3tko62WzPkNfyjNhCKxNXrqqR4ZjwC3 XTYozL/EeVU99WP8/3uwkmL5SqgEhS5cFYeSVfc51mbbprB8DP1KVAzsHUQ+fr12gJTR 3AvkhnX9bkXR9UrbeKmZTPx1oB2vA5LbmasTQ= MIME-Version: 1.0 Received: by 10.216.87.11 with SMTP id x11mr282688wee.16.1265069034128; Mon, 01 Feb 2010 16:03:54 -0800 (PST) In-Reply-To: <4B660281.5060007@gmail.com> References: <4B60DC23.9020404@gmail.com> <20100128084415.4d98823a.wmoran@potentialtech.com> <4B62236F.1090200@gmail.com> <4B660281.5060007@gmail.com> From: Gustavo Amarilla Santacruz Date: Mon, 1 Feb 2010 21:03:34 -0300 Message-ID: Subject: Re: Undefined function pg_connect() To: Chris Cc: Bill Moran , pgsql-php@postgresql.org Content-Type: multipart/alternative; boundary=0016e6d6453a6546bb047e92d6d9 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201002/1 X-Sequence-Number: 4121 --0016e6d6453a6546bb047e92d6d9 Content-Type: text/plain; charset=ISO-8859-1 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 psql tool. But from apache i can not. Note: the php.ini file was not modified. On Sun, Jan 31, 2010 at 7:21 PM, Chris wrote: > > ; Directory in which the loadable extensions (modules) reside. >> ; http://www.php.net/manual/en/ini.core.php#ini.extension-dir >> ; extension_dir = "./" >> ;extension_dir = "./;/usr/lib/php/modules/;/usr/lib/pgsql/" >> > > These should be colon separated, not semicolon - notice it's trying to load > both paths included: > > > PHP Warning: PHP Startup: Unable to load dynamic library > './;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so' > > Change it to > > > extension_dir = "./:/usr/lib/php/modules/:/usr/lib/pgsql/" > > Then, a new message was displayed: >> >> "Warning: pg_connect(): Unable to connect to PostgreSQL server: could not >> connect to server: Permission denied Is the server running on host >> "localhost" and accepting TCP/IP connections on port 5432? could not connect >> to server: Permission denied Is the server running on host "localhost" and >> accepting TCP/IP connections on port 5432?" >> > > "Permission denied" sounds like either file permissions or seLinux is > stopping the connection. > > If you have seLinux enabled, try disabling it (don't know how to do that, > sorry) - at least that will tell you if that's the problem. > > For file permissions, check your apache user can read where-ever the > postgres socket file is put (normally /tmp/.s.PGSQL.5432 on centos/rhel). > > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > > -- Gustavo Amarilla --0016e6d6453a6546bb047e92d6d9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you, all.

I had access to the SELinux->Boolean; next, i che= ck the option:

=A0Warning: pg_connect(): Unable to connect to Post= greSQL server: FATAL: Ident authentication failed for user "gestock&qu= ot; .......


I can login with gestock data (user/password) through the postgresq= l psql tool. But from apache i can not.

Note: the php.ini file was n= ot modified.

On Sun, Jan 31, 2010 at 7:21= PM, Chris <dmagi= ck@gmail.com> wrote:

; Directory in which the loadable extensions (modules) reside.
; http://www.php.net/manual/en/ini.core.php#ini.extension-di= r
; extension_dir =3D "./"
;extension_dir =3D "./;/usr/lib/php/modules/;/usr/lib/pgsql/"

These should be colon separated, not semicolon - notice it's trying to = load both paths included:


PHP Warning: =A0PHP Startup: Unable to load dynamic library './;/usr/li= b/php/modules/;/usr/lib/pgsql/curl.so'

Change it to


extension_dir =3D "./:/usr/lib/php/modules/:/usr/lib/pgsql/"

Then, a new message was displayed:

"Warning: pg_connect(): Unable to connect to PostgreSQL server: could = not connect to server: Permission denied Is the server running on host &quo= t;localhost" and accepting TCP/IP connections on port 5432? could not = connect to server: Permission denied Is the server running on host "lo= calhost" and accepting TCP/IP connections on port 5432?"

"Permission denied" sounds like either file permissions or seLinu= x is stopping the connection.

If you have seLinux enabled, try disabling it (don't know how to do tha= t, sorry) - at least that will tell you if that's the problem.

For file permissions, check your apache user can read where-ever the postgr= es socket file is put (normally /tmp/.s.PGSQL.5432 on centos/rhel).


--
Postgresql & php tutorials
http://www.desig= nmagick.com/




--
Gustavo Ama= rilla
--0016e6d6453a6546bb047e92d6d9--