Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A5161632A4C for ; Sat, 30 Jan 2010 08:33:57 -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 07557-03 for ; Sat, 30 Jan 2010 12:33:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mail.postgresql.org (Postfix) with ESMTP id 3DB7C63264C for ; Sat, 30 Jan 2010 08:33:46 -0400 (AST) Received: by ey-out-2122.google.com with SMTP id 9so575776eyd.33 for ; Sat, 30 Jan 2010 04:33:44 -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=MfXO7jCMDN2WdDCw/iC5XPYbwTd4t7Mdn4gT3DasOSs=; b=Bu5+oaZl+NrpU0HLP/EvTn8o8ugQayE3rNY23HFuPWfu/O8loAsKt5IezAGj584mKZ aS8QgoYzJ+6fA+1qzyXNW63ernommeTeHNsmj9VwCcKIxUZl2Mv0X8pU5Dk2KdwHVUox pbRYaPZWcXbCNImpQYZb/C4TyOlHZ6hdYo9RQ= 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=mtq5wqEdUVTeETsIdF6dS86f6QQpecPov9PQ6zO1jdfwKJt7aowoTfjjSuwfx6a/sB ExAe0jMmAn/w+/dlxXmfZnuUxuvLea42n4mxENbm6au+EU973iFL3LCHgBF467mzcKO7 CNcnJAPPCdjh7eDQH0L51QgPfrj7oEyGfLAUg= MIME-Version: 1.0 Received: by 10.216.162.68 with SMTP id x46mr1262013wek.2.1264854824156; Sat, 30 Jan 2010 04:33:44 -0800 (PST) In-Reply-To: References: <4B60DC23.9020404@gmail.com> <20100128084415.4d98823a.wmoran@potentialtech.com> <4B62236F.1090200@gmail.com> From: Gustavo Amarilla Santacruz Date: Sat, 30 Jan 2010 09:33:24 -0300 Message-ID: Subject: Re: Undefined function pg_connect() To: Chris Cc: Bill Moran , pgsql-php@postgresql.org Content-Type: multipart/alternative; boundary=001485f44e9a7c8179047e60f638 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.948 tagged_above=-10 required=5 tests=AWL=0.650, BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201001/20 X-Sequence-Number: 4118 --001485f44e9a7c8179047e60f638 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Jan 29, 2010 at 10:07 PM, Gustavo Amarilla Santacruz < gusamasan@gmail.com> wrote: > > > On Thu, Jan 28, 2010 at 8:53 PM, Chris wrote: > >> Gustavo Amarilla Santacruz wrote: >> >>> Thank you, Bill Moran. >>> >>> My httpd is stoped, for default. >>> >>> I used the command: service httpd start; then, the following message was >>> displayed: >>> >>> Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is >>> already loaded, skipping >>> [Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded, >>> skipping >>> httpd: Could not reliably determine the server's fully qualified domain >>> name, using localhost.localdomain for ServerName >>> [ OK ] >>> >>> >>> But the pg_connect function is not recognized. >>> >> >> Does a phpinfo() page show it loading anything re: pgsql ? >> >> Anything in apache logs (/var/log/httpd/error.log probably) ? >> >> Could seLinux be involved somehow (I'm not really sure where to look for >> this, something in /var/log should have some info) ? >> >> >> On your phpinfo page, it should have something like this: >> >> Configuration File (php.ini) Path /etc/php.ini >> Scan this dir for additional .ini files /etc/php.d >> >> >> Check whether the rpm put a file in that extra directory, like: >> >> # cat /etc/php.d/pgsql.ini >> ; Enable pgsql extension module >> extension=pgsql.so >> >> If it didn't, try doing it manually (and restart httpd) and see if pgsql >> shows up in your phpinfo page now. >> >> >> -- >> Postgresql & php tutorials >> http://www.designmagick.com/ >> >> > > > Thank you, Chris > > > > *1) Does a phpinfo() page show it loading anything re: pgsql ?* > > No, no matter info on pgsql. > > > *2) Anything in apache logs (/var/log/httpd/error.log probably) ?* > > Yes, i found this: > > . > . > . > PHP Warning: PHP Startup: Unable to load dynamic library > './;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so' - > ./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so: cannot open shared object > file: No such file or directory in Unknown on line 0 > PHP Warning: PHP Startup: Unable to load dynamic library > './;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.so' - > ./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.so: cannot open shared > object file: No such file or directory in Unknown on line 0 > PHP Warning: PHP Startup: Unable to load dynamic library > './;/usr/lib/php/modules/;/usr/lib/pgsql/json.so' - > ./;/usr/lib/php/modules/;/usr/lib/pgsql/json.so: cannot open shared object > file: No such file or directory in Unknown on line 0 > PHP Warning: PHP Startup: Unable to load dynamic library > './;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so' - > ./;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so: cannot open shared object > file: No such file or directory in Unknown on line 0 > PHP Warning: PHP Startup: Unable to load dynamic library > './;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so' - > ./;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so: cannot open shared object > file: No such file or directory in Unknown on line 0 > . > . > . > > > * > 3) On your phpinfo page, it should have something like this: > > > Configuration File (php.ini) Path /etc/php.ini > Scan this dir for additional .ini files /etc/php.d > > * > Yes, the phpinfo page has this information. > > * > 4) Check whether the rpm put a file in that extra directory, like: > > > # cat /etc/php.d/pgsql.ini > ; Enable pgsql extension module > extension=pgsql.so > * > > > Yes, the rpm put that file in /etc/php.d > > > > > ---------------------------- > Gustavo Amarilla > > I commented the php.ini line in the extension_dir parameter: *Before:* . . . ; 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/" . . . *After:* . . . ; 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/" . . . 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?" The pg_hba.conf file containt: # 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 What i can do? Thank you, in advance. -------------------------- Gustavo Amarilla --001485f44e9a7c8179047e60f638 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Fri, Jan 29, 2010 at 10:07 PM, Gustav= o Amarilla Santacruz <gusamasan@gmail.com> wrote:


On Thu= , Jan 28, 2010 at 8:53 PM, Chris <dmagick@gmail.com> wrote:<= br>
Gustavo Amarilla Santacruz wrote:
Thank you, Bill Moran.

My httpd is stoped, for default.

I used the command: service httpd start; then, the following message was di= splayed:

Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is alr= eady loaded, skipping
[Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded, ski= pping
httpd: Could not reliably determine the server's fully qualified domain= name, using localhost.localdomain for ServerName
=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 [ =A0OK =A0]


But the pg_connect function is not recognized.

Does a phpinfo() page show it loading anything re: pgsql ?

Anything in apache logs (/var/log/httpd/error.log probably) ?

Could seLinux be involved somehow (I'm not really sure where to look fo= r this, something in /var/log should have some info) ?


On your phpinfo page, it should have something like this:

Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini
Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d


Check whether the rpm put a file in that extra directory, like:

# cat /etc/php.d/pgsql.ini
; Enable pgsql extension module
extension=3Dpgsql.so

If it didn't, try doing it manually (and restart httpd) and see if pgsq= l shows up in your phpinfo page now.


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




Thank you, Chris
=


1) Does a phpinfo() page show it loading an= ything re: pgsql ?

No, no matter info on pgsql.


2) Anything in apache logs (/var/log/httpd/error.log probably) ?<= /i>

Yes, i found this:

.
.
.
PHP Warning:=A0 PHP Startup: Unable to load dynamic library = 9;./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so' - ./;/usr/lib/php/mo= dules/;/usr/lib/pgsql/curl.so: cannot open shared object file: No such file= or directory in Unknown on line 0
PHP Warning:=A0 PHP Sta= rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib= /pgsql/fileinfo.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.= so: cannot open shared object file: No such file or directory in Unknown on= line 0
PHP Warning:=A0 PHP Sta= rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib= /pgsql/json.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/json.so: cann= ot open shared object file: No such file or directory in Unknown on line 0<= /span>
PHP Warning:=A0 PHP Sta= rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib= /pgsql/ldap.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/ldap.so: cann= ot open shared object file: No such file or directory in Unknown on line 0<= /span>
PHP Warning:=A0 PHP Sta= rtup: Unable to load dynamic library './;/usr/lib/php/modules/;/usr/lib= /pgsql/mysql.so' - ./;/usr/lib/php/modules/;/usr/lib/pgsql/mysql.so: ca= nnot open shared object file: No such file or directory in Unknown on line = 0
.
.
.




3) On your phpinfo page, it should have something like th= is:


Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini
Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d


Yes, the phpinfo page has this information.


4) Check w= hether the rpm put a file in that extra directory, like:
<= br>
# cat /etc/php.d/pgsql.ini
; Enable pgsql extension module
extension=3Dpgsql.so



Yes, the rpm put that file in /etc/php.d




------= ----------------------
Gustavo Amarilla



I commented the php.ini lin= e in the extension_dir = parameter:

Before:
.
.
.
; Directory in which the loa= dable extensions (modules) reside.
; http://www.php.net/manua= l/en/ini.core.php#ini.extension-dir
; extension_dir =3D &qu= ot;./"
extension_dir =3D "./;/us= r/lib/php/modules/;/usr/lib/pgsql/"
.
.
.


After:
.
.
.
; Directory in which the loadable extensions (modules) reside.<= /span>
; http://www.php.net/manua= l/en/ini.core.php#ini.extension-dir
; extension_dir =3D &qu= ot;./"
;extension_dir =3D "./;/u= sr/lib/php/modules/;/usr/lib/pgsql/"
.
.
.



Then, a new message was displayed:

"Warning: pg_connect(): Unable to connect t= o 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?"




The pg_hb= a.conf file containt:




# TYPE=A0 DATABASE=A0=A0=A0 USER=A0=A0=A0=A0=A0=A0=A0 CID= R-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 ident



What i can do?

Thank you, in advance.


-------= -------------------
Gustavo Amarilla
--001485f44e9a7c8179047e60f638--