Thread: phpinfo() doesn't show postgres as a configured module

phpinfo() doesn't show postgres as a configured module

From
my extraidentity
Date:
When I run the PHP function phpinfo() on my server that has both Apache and PHP on it, it doesn't show postgres as a configured module.  I am running Apache version 2.0.54 and PHP version 5.2.8 (however the phpinfo() function displays that it is version 5.0.4 ; what is up with that???)

What command do I need to run to get the postgres module to work with PHP?  I have tried to configure the server this way and it didn't seem to fix it:

./configure --with-pgsql=/usr/local/pgsql/ --with-apxs2=/usr/local/apache2/bin/apxs
make

Any ideas what I am doing wrong?

-Mark


Windows Live™: Keep your life in sync. Check it out.

Re: phpinfo() doesn't show postgres as a configured module

From
Andrew McMillan
Date:
On Fri, 2009-04-10 at 19:27 -0500, my extraidentity wrote:
>         When I run the PHP function phpinfo() on my server that has
>         both Apache and PHP on it, it doesn't show postgres as a
>         configured module.  I am running Apache version 2.0.54 and PHP
>         version 5.2.8 (however the phpinfo() function displays that it
>         is version 5.0.4 ; what is up with that???)
>
>         What command do I need to run to get the postgres module to
>         work with PHP?  I have tried to configure the server this way
>         and it didn't seem to fix it:
>
>         ./configure --with-pgsql=/usr/local/pgsql/
>         --with-apxs2=/usr/local/apache2/bin/apxs
>         make
>
>         Any ideas what I am doing wrong?

You need to enable it in your php.ini file as an extension, like:

extension=pgsql.so

Cheers,
                    Andrew.

------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com                            +64(272)DEBIAN
                    Be cheerful while you are alive.
                    -- Phathotep, 24th Century B.C.

------------------------------------------------------------------------



Re: phpinfo() doesn't show postgres as a configured module

From
Steve Crawford
Date:
my extraidentity wrote:
>
>     When I run the PHP function phpinfo() on my server that has both
>     Apache and PHP on it, it doesn't show postgres as a configured
>     module.  I am running Apache version 2.0.54 and PHP version 5.2.8
>     (however the phpinfo() function displays that it is version 5.0.4
>     ; what is up with that???)
>
>     What command do I need to run to get the postgres module to work
>     with PHP?  I have tried to configure the server this way and it
>     didn't seem to fix it:
>
>     ./configure --with-pgsql=/usr/local/pgsql/
>     --with-apxs2=/usr/local/apache2/bin/apxs
>     make
>
>     Any ideas what I am doing wrong?
>
Multiple things, possibly. What OS and how did you install PHP and PG?

I'll venture a guess that you somehow installed PHP and/or PG with
whatever system installer your disro uses (yum? apt?...) and it ended up
wherever that distro specifies. Then you compiled some stuff from source
and it ended up in the "normal" locations defined by the source/makefile
defaults and you have ended up with two or more versions (5.0.4/5.2.8)
of PHP. You could even end up with Apache seeing one version and PHP
command-line seeing a different one. Once you sort that out, be sure to
enable PG in php.ini.

Cheers,
Steve

Re: phpinfo() doesn't show postgres as a configured module

From
Bob McConnell
Date:
Steve Crawford wrote:
> my extraidentity wrote:
>>
>>     When I run the PHP function phpinfo() on my server that has both
>>     Apache and PHP on it, it doesn't show postgres as a configured
>>     module.  I am running Apache version 2.0.54 and PHP version 5.2.8
>>     (however the phpinfo() function displays that it is version 5.0.4
>>     ; what is up with that???)
>>
>>     What command do I need to run to get the postgres module to work
>>     with PHP?  I have tried to configure the server this way and it
>>     didn't seem to fix it:
>>
>>     ./configure --with-pgsql=/usr/local/pgsql/
>>     --with-apxs2=/usr/local/apache2/bin/apxs
>>     make
>>
>>     Any ideas what I am doing wrong?
>>
> Multiple things, possibly. What OS and how did you install PHP and PG?
>
> I'll venture a guess that you somehow installed PHP and/or PG with
> whatever system installer your disro uses (yum? apt?...) and it ended up
> wherever that distro specifies. Then you compiled some stuff from source
> and it ended up in the "normal" locations defined by the source/makefile
> defaults and you have ended up with two or more versions (5.0.4/5.2.8)
> of PHP. You could even end up with Apache seeing one version and PHP
> command-line seeing a different one. Once you sort that out, be sure to
> enable PG in php.ini.
>
> Cheers,
> Steve

If phpinfo() doesn't show the Postgres options, it was compiled without
them. That's the same problem I have with Slackware. The packaged
version of PHP only includes the MySQL addictionware. No matter what I
do, I can't get it configured my way. So I don't install those packages,
but get the source for Apache, PHP and Postgres. That's the only way I
can make sure they get compiled and installed with my choice of options,
not those of someone with a hidden agenda trying to promote an inferior
product.

Bob McConnell
N2SPP


Re: phpinfo() doesn't show postgres as a configured module

From
Brian Fehrle
Date:
I had this exact same problem too, and a friend and I just got it
working. I'll show what we did.
I am running Sabayon Linux 4.1 (built on Gentoo)
PHP 5.2.8-r2
Apache 2.2.11
postgresql-server 8.3.5

Obviously it will depend on your configuration/distro/whatnot how you
can change it, but for me, this is how I fixed it. I'm very new to the
Linux world so I hope I phrase all this correctly.

First I edited my make file.
    # nano /etc/make.conf
In there is a line:
USE="stuffystuff"
At the very end I added "postgres" (minus the quotes) to the line, right
before the last quote. (the line was broken up into multiple lines. Each
line, except for the last, ends with \, be sure to not change any of that.)
Saved the file.

Then I emerged php and told it to use the make file.
    # emerge -N dev-lang/php
This recompiled my php, took a little while.

When that was done, I restarted the apache server.
    # /etc/init.d/apache2 restart

When it restarted, I ran my php file with phpinfo(); on it and there was
a new entry for pgsql listed.

I hope this was of some help, I'm sure if you provide some information
on your installation, someone can help do the same thing on your end.

Good Luck,
             Brian

my extraidentity wrote:
>
>     When I run the PHP function phpinfo() on my server that has both
>     Apache and PHP on it, it doesn't show postgres as a configured
>     module.  I am running Apache version 2.0.54 and PHP version 5.2.8
>     (however the phpinfo() function displays that it is version 5.0.4
>     ; what is up with that???)
>
>     What command do I need to run to get the postgres module to work
>     with PHP?  I have tried to configure the server this way and it
>     didn't seem to fix it:
>
>     ./configure --with-pgsql=/usr/local/pgsql/
>     --with-apxs2=/usr/local/apache2/bin/apxs
>     make
>
>     Any ideas what I am doing wrong?
>
>     -Mark
>
>
> ------------------------------------------------------------------------
> Windows Live™: Keep your life in sync. Check it out.
> <http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009>