pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gustavo Amarilla Santacruz <gusamasan@gmail.com>
To: Chris <dmagick@gmail.com>
Cc: Bill Moran <wmoran@potentialtech.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Undefined function pg_connect()
Date: Sat, 30 Jan 2010 09:33:24 -0300
Message-ID: <e4ea2d811001300433l7d466afdt8fa40bf4bc5fd0e8@mail.gmail.com> (raw)
In-Reply-To: <e4ea2d811001291707l62c3c8ccs4a74b9d95a43bc8b@mail.gmail.com>
References: <e4ea2d811001271625r21024e05s5b74340b322b85d5@mail.gmail.com>
	<4B60DC23.9020404@gmail.com>
	<e4ea2d811001280535j5d182a83s819a2b0590867dd5@mail.gmail.com>
	<20100128084415.4d98823a.wmoran@potentialtech.com>
	<e4ea2d811001281540x4e9f2eabp9557ea36e8f0bcbf@mail.gmail.com>
	<4B62236F.1090200@gmail.com>
	<e4ea2d811001291707l62c3c8ccs4a74b9d95a43bc8b@mail.gmail.com>

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 <dmagick@gmail.com> 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

view thread (15+ messages)  latest in thread

Message-ID: <e4ea2d811001300433l7d466afdt8fa40bf4bc5fd0e8@mail.gmail.com>
Permalink:  ../e4ea2d811001300433l7d466afdt8fa40bf4bc5fd0e8@mail.gmail.com/
Also on:    postgresql.org/message-id/e4ea2d811001300433l7d466afdt8fa40bf4bc5fd0e8@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: gusamasan@gmail.com, dmagick@gmail.com, wmoran@potentialtech.com
  Subject: Re: Undefined function pg_connect()
  In-Reply-To: <e4ea2d811001300433l7d466afdt8fa40bf4bc5fd0e8@mail.gmail.com>
  References: <e4ea2d811001271625r21024e05s5b74340b322b85d5@mail.gmail.com> <4B60DC23.9020404@gmail.com> <e4ea2d811001280535j5d182a83s819a2b0590867dd5@mail.gmail.com> <20100128084415.4d98823a.wmoran@potentialtech.com> <e4ea2d811001281540x4e9f2eabp9557ea36e8f0bcbf@mail.gmail.com> <4B62236F.1090200@gmail.com> <e4ea2d811001291707l62c3c8ccs4a74b9d95a43bc8b@mail.gmail.com> <e4ea2d811001300433l7d466afdt8fa40bf4bc5fd0e8@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox