Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: Undefined function pg_connect()

Posted on 2010-01-28 01:25:44 by Gustavo Amarilla Santacruz

--0016e65b40e277be84047e2e902f
Content-Type: text/plain; charset=ISO-8859-1

Hello, all.

I had installed php + postgresql on Fedora12. When the php script call to
"pg_connect()", the following message is displayed:

Fatal error: Call to undefined function pg_connect() in /var/www/html/ .....
Call Stack: 0.0325 487160 1. {main}() ....


What i can do?


Thank you, in advance.


-------------------------
Gustavo Amarilla

--0016e65b40e277be84047e2e902f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello, all.<br><br>I had installed php + postgresql on Fedora12. When the p=
hp script call to &quot;pg_connect()&quot;, the following message is displa=
yed:<br><br><span style=3D"font-family: courier new,monospace;">Fatal error=
: Call to undefined function pg_connect() in
/var/www/html/ ..... Call Stack: 0.0325 487160 1. {main}()
.....</span><br><br><br>What i can do?<br clear=3D"all"><br><br>Thank you, i=
n advance.<br><br><br>------------------------- <br>Gustavo Amarilla<br>

--0016e65b40e277be84047e2e902f--

Report this message

#2: Re: Undefined function pg_connect()

Posted on 2010-01-28 01:36:51 by dmagick

Gustavo Amarilla Santacruz wrote:
> Hello, all.
>
> I had installed php + postgresql on Fedora12. When the php script call
> to "pg_connect()", the following message is displayed:
>
> Fatal error: Call to undefined function pg_connect() in /var/www/html/
> ..... Call Stack: 0.0325 487160 1. {main}() ....
>
>
> What i can do?

You need the php-pgsql package if you installed via rpm.

Once you have that installed, restart apache and see how you go.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Report this message

#3: Re: Undefined function pg_connect()

Posted on 2010-01-28 01:40:47 by devrim

On Wed, 2010-01-27 at 21:25 -0300, Gustavo Amarilla Santacruz wrote:

> I had installed php + postgresql on Fedora12. When the php script call
> to "pg_connect()", the following message is displayed:
>=20
> Fatal error: Call to undefined function pg_connect()=20

If you are installing from RPMs, you also need to install php-pgsql
package. If you are installing from sources, you will need to recompile
with PostgreSQL support.

--=20
Devrim GÜNDÜZ, RHCE
Command Prompt - http://www.CommandPrompt.com=20
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz


--=20
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Report this message

#4: Re: Undefined function pg_connect()

Posted on 2010-01-28 14:35:49 by Gustavo Amarilla Santacruz

--0016e6d9746e06ed47047e399af1
Content-Type: text/plain; charset=ISO-8859-1

Thank you, Chris.

I use the yum command and i got the following result:

yum install php-pgsql
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest version
Nothing to do


What i can do?

Thank you, in advance.



On Wed, Jan 27, 2010 at 9:36 PM, Chris <dmagick@gmail.com> wrote:

> Gustavo Amarilla Santacruz wrote:
>
>> Hello, all.
>>
>> I had installed php + postgresql on Fedora12. When the php script call to
>> "pg_connect()", the following message is displayed:
>>
>> Fatal error: Call to undefined function pg_connect() in /var/www/html/
>> ..... Call Stack: 0.0325 487160 1. {main}() ....
>>
>>
>> What i can do?
>>
>
> You need the php-pgsql package if you installed via rpm.
>
> Once you have that installed, restart apache and see how you go.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>


---------------------------
Gustavo Amarilla

--0016e6d9746e06ed47047e399af1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Chris.<br><br>I use the=A0 yum command and i got the following r=
esult:<br><br><span style=3D"font-family: courier new,monospace;">yum insta=
ll php-pgsql</span><br style=3D"font-family: courier new,monospace;"><span =
style=3D"font-family: courier new,monospace;">Loaded plugins: presto, refre=
sh-packagekit</span><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">Setting up Install Proc=
ess</span><br style=3D"font-family: courier new,monospace;"><span style=3D"=
font-family: courier new,monospace;">Package php-pgsql-5.3.1-1.fc12.i686 al=
ready installed and latest version</span><br style=3D"font-family: courier =
new,monospace;">

<span style=3D"font-family: courier new,monospace;">Nothing to do</span><br=
><br><br>What i can do?<br><br>Thank you, in advance.<br><br><br><br><div c=
lass=3D"gmail_quote">On Wed, Jan 27, 2010 at 9:36 PM, Chris <span dir=3D"lt=
r">&lt;<a href=3D"mailto:dmagick@gmail.com">dmagick@gmail.com</a>&gt;</span=
> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class=3D"im"=
>Gustavo Amarilla Santacruz wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello, all.<br>
<br>
I had installed php + postgresql on Fedora12. When the php script call to &=
quot;pg_connect()&quot;, the following message is displayed:<br>
<br>
Fatal error: Call to undefined function pg_connect() in /var/www/html/ ....=
.. Call Stack: 0.0325 487160 1. {main}() ....<br>
<br>
<br>
What i can do?<br>
</blockquote>
<br></div>
You need the php-pgsql package if you installed via rpm.<br>
<br>
Once you have that installed, restart apache and see how you go.<br><font c=
olor=3D"#888888">
<br>
-- <br>
Postgresql &amp; php tutorials<br>
<a href=3D"http://www.designmagick.com/" target=3D"_blank">http://www.desig=
nmagick.com/</a><br>
<br>
</font></blockquote></div><br><br clear=3D"all"><br>-----------------------=
---- <br>Gustavo Amarilla<br>

--0016e6d9746e06ed47047e399af1--

Report this message

#5: Re: Undefined function pg_connect()

Posted on 2010-01-28 14:44:15 by Bill Moran

In response to Gustavo Amarilla Santacruz <gusamasan@gmail.com>:

> Thank you, Chris.
>
> I use the yum command and i got the following result:
>
> yum install php-pgsql
> Loaded plugins: presto, refresh-packagekit
> Setting up Install Process
> Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest version
> Nothing to do

Have you restarted Apache since it was successfully installed?

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Report this message

#6: Re: Undefined function pg_connect()

Posted on 2010-01-29 00:40:48 by Gustavo Amarilla Santacruz

--001485f44e9a9e28b6047e420d34
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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.

On Thu, Jan 28, 2010 at 10:44 AM, Bill Moran <wmoran@potentialtech.com>wrot=
e:

> In response to Gustavo Amarilla Santacruz <gusamasan@gmail.com>:
>
> > Thank you, Chris.
> >
> > I use the yum command and i got the following result:
> >
> > yum install php-pgsql
> > Loaded plugins: presto, refresh-packagekit
> > Setting up Install Process
> > Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest versio=
n
> > Nothing to do
>
> Have you restarted Apache since it was successfully installed?
>
> --
> Bill Moran
> http://www.potentialtech.com
> http://people.collaborativefusion.com/~wmoran/<http://people.collaborativ=
efusion.com/%7Ewmoran/>
>



--=20
Gustavo Amarilla

=BFReciclaste papel, hoy?

--001485f44e9a9e28b6047e420d34
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Bill Moran.<br><br>My httpd is stoped, for default.<br><br>I use=
d the command:<span style=3D"font-family: courier new,monospace;"> service =
httpd start</span>; then, the following message was displayed:<br><br><span=
style=3D"font-family: courier new,monospace;">Starting httpd: [Thu Jan 28 =
20:27:39 2010] [warn] module perl_module is already loaded, skipping</span>=
<br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">[Thu Jan 28 20:27:39 20=
10] [warn] module php5_module is already loaded, skipping</span><br style=
=3D"font-family: courier new,monospace;"><span style=3D"font-family: courie=
r new,monospace;">httpd: Could not reliably determine the server&#39;s full=
y qualified domain name, using localhost.localdomain for ServerName</span><=
br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">      =A0=
                         =A0=
                         =A0=
=A0 [=A0 OK=A0 ]</span><br><br><br>But the pg_connect function is not recog=
nized.<br><br><div class=3D"gmail_quote">On Thu, Jan 28, 2010 at 10:44 AM, =
Bill Moran <span dir=3D"ltr">&lt;<a href=3D"mailto:wmoran@potentialtech.com=
">wmoran@potentialtech.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In response to Gu=
stavo Amarilla Santacruz &lt;<a href=3D"mailto:gusamasan@gmail.com">gusamas=
an@gmail.com</a>&gt;:<br>


<div class=3D"im"><br>
&gt; Thank you, Chris.<br>
&gt;<br>
&gt; I use the =A0yum command and i got the following result:<br>
&gt;<br>
&gt; yum install php-pgsql<br>
&gt; Loaded plugins: presto, refresh-packagekit<br>
&gt; Setting up Install Process<br>
&gt; Package php-pgsql-5.3.1-1.fc12.i686 already installed and latest versi=
on<br>
&gt; Nothing to do<br>
<br>
</div>Have you restarted Apache since it was successfully installed?<br>
<div><div></div><div class=3D"h5"><br>
--<br>
Bill Moran<br>
<a href=3D"http://www.potentialtech.com" target=3D"_blank">http://www.poten=
tialtech.com</a><br>
<a href=3D"http://people.collaborativefusion.com/%7Ewmoran/" target=3D"_bla=
nk">http://people.collaborativefusion.com/~wmoran/</a><br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Gustavo Ama=
rilla<br><br>=BFReciclaste papel, hoy?<br>

--001485f44e9a9e28b6047e420d34--

Report this message

#7: Re: Undefined function pg_connect()

Posted on 2010-01-29 00:53:19 by dmagick

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/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Report this message

#8: Re: Undefined function pg_connect()

Posted on 2010-01-30 02:07:27 by Gustavo Amarilla Santacruz

--0016e6dab0fd566b97047e5761d3
Content-Type: text/plain; charset=ISO-8859-1

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

--0016e6dab0fd566b97047e5761d3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Thu, Jan 28, 2010 at 8:53 PM, Chris <=
span dir=3D"ltr">&lt;<a href=3D"mailto:dmagick@gmail.com">dmagick@gmail.com=
</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"border=
-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-lef=
t: 1ex;">

<div class=3D"im">Gustavo Amarilla Santacruz wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you, Bill Moran.<br>
<br>
My httpd is stoped, for default.<br>
<br>
I used the command: service httpd start; then, the following message was di=
splayed:<br>
<br>
Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is alr=
eady loaded, skipping<br>
[Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded, ski=
pping<br>
httpd: Could not reliably determine the server&#39;s fully qualified domain=
name, using localhost.localdomain for ServerName<br>
=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]<br>
<br>
<br>
But the pg_connect function is not recognized.<br>
</blockquote>
<br></div>
Does a phpinfo() page show it loading anything re: pgsql ?<br>
<br>
Anything in apache logs (/var/log/httpd/error.log probably) ?<br>
<br>
Could seLinux be involved somehow (I&#39;m not really sure where to look fo=
r this, something in /var/log should have some info) ?<br>
<br>
<br>
On your phpinfo page, it should have something like this:<br>
<br>
Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini<br>
Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d<br>
<br>
<br>
Check whether the rpm put a file in that extra directory, like:<br>
<br>
# cat /etc/php.d/pgsql.ini<br>
; Enable pgsql extension module<br>
extension=3Dpgsql.so<br>
<br>
If it didn&#39;t, try doing it manually (and restart httpd) and see if pgsq=
l shows up in your phpinfo page now.<div><div></div><div class=3D"h5"><br>
<br>
-- <br>
Postgresql &amp; php tutorials<br>
<a href=3D"http://www.designmagick.com/" target=3D"_blank">http://www.desig=
nmagick.com/</a><br>
<br>
</div></div></blockquote></div><br><br><br>Thank you, Chris<br><br><br><br =
clear=3D"all"><b><i>1) Does a phpinfo() page show it loading anything re: p=
gsql ?</i></b><br><br>No, no matter info on pgsql.<br><br><br><i><b>2) Anyt=
hing in apache logs (/var/log/httpd/error.log probably) ?</b></i><br>

<br>Yes, i found this:<br><br style=3D"font-family: courier new,monospace;"=
><span style=3D"font-family: courier new,monospace;">.</span><br style=3D"f=
ont-family: courier new,monospace;"><span style=3D"font-family: courier new=
,monospace;">.</span><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">PHP Warning:=A0 PHP Startup: Unable to load dynamic library &#3=
9;./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so&#39; - ./;/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</span><br style=3D"font-family: courier =
new,monospace;">

<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/fileinfo.so&#39; - ./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.=
so: cannot open shared object file: No such file or directory in Unknown on=
line 0</span><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/json.so&#39; - ./;/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><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/ldap.so&#39; - ./;/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><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/mysql.so&#39; - ./;/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</span><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">.</span><br style=3D"font-family: courier new,monospace;"><span=
style=3D"font-family: courier new,monospace;">.</span><br>

<br><br><b><br><i>3) On your phpinfo page, it should have something like th=
is:<br><br>
Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini<br>
Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d<br></i><=
br></b>

<br>Yes, the phpinfo page has this information.<br><br><b><i><br>4) Check w=
hether the rpm put a file in that extra directory, like:<br><br>
# cat /etc/php.d/pgsql.ini<br>
; Enable pgsql extension module<br>
extension=3Dpgsql.so</i></b>
<br>
<br><br>Yes, the rpm put that file in /etc/php.d<br><br><br><br><br>------=
---------------------- <br>Gustavo Amarilla<br><br>

--0016e6dab0fd566b97047e5761d3--

Report this message

#9: Re: Undefined function pg_connect()

Posted on 2010-01-30 13:33:24 by Gustavo Amarilla Santacruz

--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 <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

--001485f44e9a7c8179047e60f638
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Fri, Jan 29, 2010 at 10:07 PM, Gustav=
o Amarilla Santacruz <span dir=3D"ltr">&lt;<a href=3D"mailto:gusamasan@gmai=
l.com">gusamasan@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gm=
ail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt =
0pt 0pt 0.8ex; padding-left: 1ex;">

<div><div></div><div class=3D"h5"><br><br><div class=3D"gmail_quote">On Thu=
, Jan 28, 2010 at 8:53 PM, Chris <span dir=3D"ltr">&lt;<a href=3D"mailto:dm=
agick@gmail.com" target=3D"_blank">dmagick@gmail.com</a>&gt;</span> wrote:<=
br><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(20=
4, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div>Gustavo Amarilla Santacruz wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you, Bill Moran.<br>
<br>
My httpd is stoped, for default.<br>
<br>
I used the command: service httpd start; then, the following message was di=
splayed:<br>
<br>
Starting httpd: [Thu Jan 28 20:27:39 2010] [warn] module perl_module is alr=
eady loaded, skipping<br>
[Thu Jan 28 20:27:39 2010] [warn] module php5_module is already loaded, ski=
pping<br>
httpd: Could not reliably determine the server&#39;s fully qualified domain=
name, using localhost.localdomain for ServerName<br>
=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]<br>
<br>
<br>
But the pg_connect function is not recognized.<br>
</blockquote>
<br></div>
Does a phpinfo() page show it loading anything re: pgsql ?<br>
<br>
Anything in apache logs (/var/log/httpd/error.log probably) ?<br>
<br>
Could seLinux be involved somehow (I&#39;m not really sure where to look fo=
r this, something in /var/log should have some info) ?<br>
<br>
<br>
On your phpinfo page, it should have something like this:<br>
<br>
Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini<br>
Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d<br>
<br>
<br>
Check whether the rpm put a file in that extra directory, like:<br>
<br>
# cat /etc/php.d/pgsql.ini<br>
; Enable pgsql extension module<br>
extension=3Dpgsql.so<br>
<br>
If it didn&#39;t, try doing it manually (and restart httpd) and see if pgsq=
l shows up in your phpinfo page now.<div><div></div><div><br>
<br>
-- <br>
Postgresql &amp; php tutorials<br>
<a href=3D"http://www.designmagick.com/" target=3D"_blank">http://www.desig=
nmagick.com/</a><br>
<br>
</div></div></blockquote></div><br><br><br></div></div>Thank you, Chris<br>=
<br><br><br clear=3D"all"><b><i>1) Does a phpinfo() page show it loading an=
ything re: pgsql ?</i></b><br><br>No, no matter info on pgsql.<br><br><br>

<i><b>2) Anything in apache logs (/var/log/httpd/error.log probably) ?</b><=
/i><br>
<br>Yes, i found this:<br><br style=3D"font-family: courier new,monospace;"=
><span style=3D"font-family: courier new,monospace;">.</span><br style=3D"f=
ont-family: courier new,monospace;"><span style=3D"font-family: courier new=
,monospace;">.</span><br style=3D"font-family: courier new,monospace;">


<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">PHP Warning:=A0 PHP Startup: Unable to load dynamic library &#3=
9;./;/usr/lib/php/modules/;/usr/lib/pgsql/curl.so&#39; - ./;/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</span><br style=3D"font-family: courier =
new,monospace;">


<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/fileinfo.so&#39; - ./;/usr/lib/php/modules/;/usr/lib/pgsql/fileinfo.=
so: cannot open shared object file: No such file or directory in Unknown on=
line 0</span><br style=3D"font-family: courier new,monospace;">


<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/json.so&#39; - ./;/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><br style=3D"font-family: courier new,monospace;">


<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/ldap.so&#39; - ./;/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><br style=3D"font-family: courier new,monospace;">


<span style=3D"font-family: courier new,monospace;">PHP Warning:=A0 PHP Sta=
rtup: Unable to load dynamic library &#39;./;/usr/lib/php/modules/;/usr/lib=
/pgsql/mysql.so&#39; - ./;/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</span><br style=3D"font-family: courier new,monospace;">


<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">.</span><br style=3D"font-family: courier new,monospace;"><span=
style=3D"font-family: courier new,monospace;">.</span><br>


<br><br><b><br><i>3) On your phpinfo page, it should have something like th=
is:<div class=3D"im"><br><br>
Configuration File (php.ini) Path =A0 =A0 =A0 /etc/php.ini<br>
Scan this dir for additional .ini files =A0 =A0 =A0 =A0 /etc/php.d<br></div=
></i><br></b>

<br>Yes, the phpinfo page has this information.<br><br><b><i><br>4) Check w=
hether the rpm put a file in that extra directory, like:<div class=3D"im"><=
br><br>
# cat /etc/php.d/pgsql.ini<br>
; Enable pgsql extension module<br>
extension=3Dpgsql.so</div></i></b>
<br>
<br><br>Yes, the rpm put that file in /etc/php.d<br><br><br><br><br>------=
---------------------- <br><font color=3D"#888888">Gustavo Amarilla<br><br>
</font></blockquote></div><br><br clear=3D"all">I commented the php.ini lin=
e in the <span style=3D"font-family: courier new,monospace;">extension_dir =
</span>parameter:<br><br><i><b>Before:</b></i><br><span style=3D"font-famil=
y: courier new,monospace;">.</span><br style=3D"font-family: courier new,mo=
nospace;">

<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">.</span><br style=3D"font-family: courier new,monospace;"><span=
style=3D"font-family: courier new,monospace;">; Directory in which the loa=
dable extensions (modules) reside.</span><br style=3D"font-family: courier =
new,monospace;">

<span style=3D"font-family: courier new,monospace;">; <a href=3D"http://www=
..php.net/manual/en/ini.core.php#ini.extension-dir">http://w ww.php.net/manua=
l/en/ini.core.php#ini.extension-dir</a></span><br style=3D"font-family: cou=
rier new,monospace;">

<span style=3D"font-family: courier new,monospace;">; extension_dir =3D &qu=
ot;./&quot;</span><br style=3D"font-family: courier new,monospace;"><span s=
tyle=3D"font-family: courier new,monospace;">extension_dir =3D &quot;./;/us=
r/lib/php/modules/;/usr/lib/pgsql/&quot;</span><br style=3D"font-family: co=
urier new,monospace;">

<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">.</span><br style=3D"font-family: courier new,monospace;"><span=
style=3D"font-family: courier new,monospace;">.</span><br>

<br><br><i><b>After:</b></i><br><span style=3D"font-family: courier new,mon=
ospace;">.</span><br style=3D"font-family: courier new,monospace;"><span st=
yle=3D"font-family: courier new,monospace;">.</span><br style=3D"font-famil=
y: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">; Directory in which the loadable extensions (modules) reside.<=
/span><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">; <a href=3D"http://www=
..php.net/manual/en/ini.core.php#ini.extension-dir">http://w ww.php.net/manua=
l/en/ini.core.php#ini.extension-dir</a></span><br style=3D"font-family: cou=
rier new,monospace;">

<span style=3D"font-family: courier new,monospace;">; extension_dir =3D &qu=
ot;./&quot;</span><br style=3D"font-family: courier new,monospace;"><span s=
tyle=3D"font-family: courier new,monospace;">;extension_dir =3D &quot;./;/u=
sr/lib/php/modules/;/usr/lib/pgsql/&quot;</span><br style=3D"font-family: c=
ourier new,monospace;">

<span style=3D"font-family: courier new,monospace;">.</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">.</span><br style=3D"font-family: courier new,monospace;"><span=
style=3D"font-family: courier new,monospace;">.</span><br>

<br><br>Then, a new message was displayed:<br><br><span style=3D"font-famil=
y: courier new,monospace;">&quot;Warning: pg_connect(): Unable to connect t=
o PostgreSQL server: could not connect to server: Permission denied
Is the server running on host &quot;localhost&quot; and accepting
TCP/IP connections on port 5432?
could not connect to server: Permission denied
Is the server running on host &quot;localhost&quot; and accepting
TCP/IP connections on port 5432?&quot;</span><br><br><br><br><br>The pg_hb=
a.conf file containt:<br><br><br><br><br><span style=3D"font-family: courie=
r new,monospace;"># TYPE=A0 DATABASE  =A0 USER      =A0 CID=
R-ADDRESS        =A0 METHOD</span><br style=3D"font-family:=
courier new,monospace;">

<br style=3D"font-family: courier new,monospace;"><span style=3D"font-famil=
y: courier new,monospace;"># &quot;local&quot; is for Unix domain socket co=
nnections only</span><br style=3D"font-family: courier new,monospace;"><spa=
n style=3D"font-family: courier new,monospace;">local   all    =
     all                  =A0 =
            =A0 trust</span><br style=3D"font-famil=
y: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;"># IPv4 local connection=
s:</span><br style=3D"font-family: courier new,monospace;"><span style=3D"f=
ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         127.0.0.1 255.255.255.0 trust</span><br sty=
le=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;"># IPv6 local connection=
s:</span><br style=3D"font-family: courier new,monospace;"><span style=3D"f=
ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         ::1/128            =
   ident</span><br style=3D"font-family: courier new,monospace;">

<br><br><br>What i can do?<br><br>Thank you, in advance.<br><br><br>-------=
------------------- <br>Gustavo Amarilla<br>

--001485f44e9a7c8179047e60f638--

Report this message

#10: Re: Undefined function pg_connect()

Posted on 2010-01-30 13:53:11 by Rod

On 30/01/2010 12:33, Gustavo Amarilla Santacruz wrote:
> "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:
>



Sounds like you're getting somewhere - the PG extension is being found now.

The error above is nothing to do with pg_hba.conf; if the connection was
being denied because of a rule there, the error would say so explicitly.
Rather, it's a network problem of some kind. Is the server actually
running? Is there a firewall preventing access?

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Report this message

#11: Re: Undefined function pg_connect()

Posted on 2010-01-31 23:21:53 by dmagick

> ; 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/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Report this message

#12: Re: Undefined function pg_connect()

Posted on 2010-02-02 01:03:34 by Gustavo Amarilla Santacruz

--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 <dmagick@gmail.com> 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.<br><br>I had access to the SELinux-&gt;Boolean; next, i che=
ck the option:<br><br>=A0<span style=3D"font-family: courier new,monospace;=
">&quot;Allow HTTPD scripts and modules to connect to databases over the ne=
twork&quot;</span>. <br>

<br><br>Then, a new message was displayed:<br><br><span style=3D"font-famil=
y: courier new,monospace;">Warning: pg_connect(): Unable to connect to Post=
greSQL server: FATAL: Ident authentication failed for user &quot;gestock&qu=
ot; .......</span><br>

<br><br>I can login with gestock data (user/password) through the postgresq=
l psql tool. But from apache i can not.<br><br>Note: the php.ini file was n=
ot modified.<br><br><div class=3D"gmail_quote">On Sun, Jan 31, 2010 at 7:21=
PM, Chris <span dir=3D"ltr">&lt;<a href=3D"mailto:dmagick@gmail.com">dmagi=
ck@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class=3D"im"=
><br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
; Directory in which the loadable extensions (modules) reside.<br>
; <a href=3D"http://www.php.net/manual/en/ini.core.php#ini.extension-dir" t=
arget=3D"_blank">http://www.php.net/manual/en/ini.core.php#i ni.extension-di=
r</a><br>
; extension_dir =3D &quot;./&quot;<br>
;extension_dir =3D &quot;./;/usr/lib/php/modules/;/usr/lib/pgsql/&quot;<br>
</blockquote>
<br></div>
These should be colon separated, not semicolon - notice it&#39;s trying to =
load both paths included:<div class=3D"im"><br>
<br>
PHP Warning: =A0PHP Startup: Unable to load dynamic library &#39;./;/usr/li=
b/php/modules/;/usr/lib/pgsql/curl.so&#39;<br>
<br></div>
Change it to<div class=3D"im"><br>
<br>
extension_dir =3D &quot;./:/usr/lib/php/modules/:/usr/lib/pgsql/&quot;<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Then, a new message was displayed:<br>
<br>
&quot;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&quot; and accepting TCP/IP connections on port 5432? could not =
connect to server: Permission denied Is the server running on host &quot;lo=
calhost&quot; and accepting TCP/IP connections on port 5432?&quot;<br>


</blockquote>
<br></div>
&quot;Permission denied&quot; sounds like either file permissions or seLinu=
x is stopping the connection.<br>
<br>
If you have seLinux enabled, try disabling it (don&#39;t know how to do tha=
t, sorry) - at least that will tell you if that&#39;s the problem.<br>
<br>
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).<div><di=
v></div><div class=3D"h5"><br>
<br>
-- <br>
Postgresql &amp; php tutorials<br>
<a href=3D"http://www.designmagick.com/" target=3D"_blank">http://www.desig=
nmagick.com/</a><br>
<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Gustavo Ama=
rilla<br>

--0016e6d6453a6546bb047e92d6d9--

Report this message

#13: Re: Undefined function pg_connect()

Posted on 2010-02-02 01:13:33 by dmagick

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
> psql 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/


--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php

Report this message

#14: Re: Undefined function pg_connect()

Posted on 2010-02-02 01:51:00 by Gustavo Amarilla Santacruz

--0016e6d7df780852a3047e938054
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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 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:
>>
>> "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 psq=
l
>> 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/
>
>


--=20
Gustavo Amarilla

=BFReciclaste papel, hoy?

--0016e6d7df780852a3047e938054
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, Chris.<br><br>The pg_hba.conf contained:<br><br># TYPE=A0 DATABA=
SE  =A0 USER      =A0 CIDR-ADDRESS        =
=A0 METHOD<br><br># &quot;local&quot; is for Unix domain socket connections=
only<br>local   all         all      =A0=
                         =A0=
trust<br>

# IPv4 local connections:<br>host  =A0 all         all=
         127.0.0.1 255.255.255.0 trust<br># IPv6 local conn=
ections:<br>host  =A0 all         all      =
   ::1/128               ident<br><br><br>B=
efore, i modified to:<br>
<br>
# TYPE=A0 DATABASE  =A0 USER      =A0 CIDR-ADDRESS  =A0=
       METHOD<br><br># &quot;local&quot; is for Unix domain soc=
ket connections only<br>local   all         all  =
                         =A0=
    =A0 trust<br># IPv4 local connections:<br>

host  =A0 all         all         127.0=
..0.1 255.255.255.0 trust<br># IPv6 local connections:<br>host  =A0 all=
         all         ::1/128    =A0=
        =A0 trust<br><br><br>Then i can login me. But, how =
i Know that apache is using IPV6 connections?<br>

<br><br><div class=3D"gmail_quote">On Mon, Feb 1, 2010 at 9:13 PM, Chris <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:dmagick@gmail.com">dmagick@gmail.com<=
/a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"border-=
left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left=
: 1ex;">

<div class=3D"im">Gustavo Amarilla Santacruz wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you, all.<br>
<br>
I had access to the SELinux-&gt;Boolean; next, i check the option:<br>
<br>
=A0&quot;Allow HTTPD scripts and modules to connect to databases over the n=
etwork&quot;.<br>
<br>
<br>
Then, a new message was displayed:<br>
<br>
Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident=
authentication failed for user &quot;gestock&quot; .......<br>
<br>
<br>
I can login with gestock data (user/password) through the postgresql psql t=
ool. But from apache i can not.<br>
</blockquote>
<br></div>
It&#39;s not using the password, it&#39;s just checking the username to see=
if you&#39;re logged in as &#39;gestock&#39; (but &#39;apache&#39; is not =
&#39;gestock&#39;, hence the error).<br>
<br>
What does your postgresql pg_hba.conf file look like?<div><div></div><div c=
lass=3D"h5"><br>
<br>
-- <br>
Postgresql &amp; php tutorials<br>
<a href=3D"http://www.designmagick.com/" target=3D"_blank">http://www.desig=
nmagick.com/</a><br>
<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Gustavo Ama=
rilla<br><br>=BFReciclaste papel, hoy?<br>

--0016e6d7df780852a3047e938054--

Report this message

#15: Re: Undefined function pg_connect()

Posted on 2010-02-02 01:54:33 by Gustavo Amarilla Santacruz

--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 <dmagick@gmail.com> 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.<br><br>The correct post is the=
following:<br><br><br>Thank you, Chris.<br><br>The <span style=3D"font-fam=
ily: courier new,monospace;">pg_hba.conf</span> file contained this:<br><br=
>

<span style=3D"font-family: courier new,monospace;"># TYPE=A0 DATABASE=A0=
   USER      =A0 CIDR-ADDRESS        =A0 ME=
THOD</span><br style=3D"font-family: courier new,monospace;"><br style=3D"f=
ont-family: courier new,monospace;"><span style=3D"font-family: courier new=
,monospace;"># &quot;local&quot; is for Unix domain socket connections only=
</span><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">local   all  =
       all                =A0=
              =A0 trust</span><br style=3D"font=
-family: courier new,monospace;"><span style=3D"font-family: courier new,mo=
nospace;"># IPv4 local connections:</span><br style=3D"font-family: courier=
new,monospace;">

<span style=3D"font-family: courier new,monospace;">host  =A0 all  =
       all         127.0.0.1 255.255.255.0 trus=
t</span><br style=3D"font-family: courier new,monospace;"><span style=3D"fo=
nt-family: courier new,monospace;"># IPv6 local connections:</span><br styl=
e=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">host  =A0 all  =
       all         ::1/128      =A0=
      =A0 ident</span><br><br><br>After, i modified it to:<br><=
br><span style=3D"font-family: courier new,monospace;"># TYPE=A0 DATABASE=
  =A0 USER      =A0 CIDR-ADDRESS        =A0=
METHOD</span><br style=3D"font-family: courier new,monospace;">

<br style=3D"font-family: courier new,monospace;"><span style=3D"font-famil=
y: courier new,monospace;"># &quot;local&quot; is for Unix domain socket co=
nnections only</span><br style=3D"font-family: courier new,monospace;"><spa=
n style=3D"font-family: courier new,monospace;">local   all    =
     all                  =A0 =
            =A0 trust</span><br style=3D"font-famil=
y: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;"># IPv4 local connection=
s:</span><br style=3D"font-family: courier new,monospace;"><span style=3D"f=
ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         127.0.0.1 255.255.255.0 trust</span><br sty=
le=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;"># IPv6 local connection=
s:</span><br style=3D"font-family: courier new,monospace;"><span style=3D"f=
ont-family: courier new,monospace;">host  =A0 all      =A0=
=A0 all         ::1/128            =
   trust</span><br style=3D"font-family: courier new,monospace;">

<br><br>Then i can login me from php scripts. But, how i Know that apache i=
s using IPV6 connections?<br><br><div class=3D"gmail_quote">On Mon, Feb 1, =
2010 at 9:51 PM, Gustavo Amarilla Santacruz <span dir=3D"ltr">&lt;<a href=
=3D"mailto:gusamasan@gmail.com">gusamasan@gmail.com</a>&gt;</span> wrote:<b=
r>

<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thank you, Chris.=
<br><br>The pg_hba.conf contained:<div class=3D"im"><br><br># TYPE=A0 DATAB=
ASE  =A0 USER      =A0 CIDR-ADDRESS        =
=A0 METHOD<br>

<br># &quot;local&quot; is for Unix domain socket connections only<br>local=
   all         all            =
                     trust<br>
# IPv4 local connections:<br>host  =A0 all         all=
         127.0.0.1 255.255.255.0 trust<br># IPv6 local conn=
ections:<br>host  =A0 all         all      =
   ::1/128               ident<br><br><br><=
/div>Before, i modified to:<div class=3D"im">

<br><br>
# TYPE=A0 DATABASE  =A0 USER      =A0 CIDR-ADDRESS  =A0=
       METHOD<br><br># &quot;local&quot; is for Unix domain soc=
ket connections only<br>local   all         all  =
                         =A0=
    =A0 trust<br># IPv4 local connections:<br>


host  =A0 all         all         127.0=
..0.1 255.255.255.0 trust<br># IPv6 local connections:<br></div>host  =
=A0 all         all         ::1/128  =
             trust<br><br><br>Then i can login me. =
But, how i Know that apache is using IPV6 connections?<div>

<div></div><div class=3D"h5"><br>
<br><br><div class=3D"gmail_quote">On Mon, Feb 1, 2010 at 9:13 PM, Chris <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:dmagick@gmail.com" target=3D"_blank">=
dmagick@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote=
" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0=
..8ex; padding-left: 1ex;">


<div>Gustavo Amarilla Santacruz wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you, all.<br>
<br>
I had access to the SELinux-&gt;Boolean; next, i check the option:<br>
<br>
=A0&quot;Allow HTTPD scripts and modules to connect to databases over the n=
etwork&quot;.<br>
<br>
<br>
Then, a new message was displayed:<br>
<br>
Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident=
authentication failed for user &quot;gestock&quot; .......<br>
<br>
<br>
I can login with gestock data (user/password) through the postgresql psql t=
ool. But from apache i can not.<br>
</blockquote>
<br></div>
It&#39;s not using the password, it&#39;s just checking the username to see=
if you&#39;re logged in as &#39;gestock&#39; (but &#39;apache&#39; is not =
&#39;gestock&#39;, hence the error).<br>
<br>
What does your postgresql pg_hba.conf file look like?<div><div></div><div><=
br>
<br>
-- <br>
Postgresql &amp; php tutorials<br>
<a href=3D"http://www.designmagick.com/" target=3D"_blank">http://www.desig=
nmagick.com/</a><br>
<br>
</div></div></blockquote></div><br><br clear=3D"all"><br></div></div><div><=
div></div><div class=3D"h5">-- <br>Gustavo Amarilla<br><br>=BFReciclaste pa=
pel, hoy?<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Gustavo Ama=
rilla<br><br>=BFReciclaste papel, hoy?<br>

--0016e6d7e32dba16c2047e938c81--

Report this message