build PHP 5.2.4 with PostgreSQL support - Slackware

This is a discussion on build PHP 5.2.4 with PostgreSQL support - Slackware ; I've been unable to build PHP 5.2.4 with PostgreSQL support. I have PostgreSQL 8.2.4 installed. I've taken the php.SlackBuild from the source, modified it to include the lines --with-pgsql=shared,/usr/local/pgsql --with-pdo-pgsql=shared,/usr/local/pgsql in the php_configure() function. When I then build PHP, and ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: build PHP 5.2.4 with PostgreSQL support

  1. build PHP 5.2.4 with PostgreSQL support

    I've been unable to build PHP 5.2.4 with PostgreSQL support. I have
    PostgreSQL 8.2.4 installed.

    I've taken the php.SlackBuild from the source, modified it to include the
    lines

    --with-pgsql=shared,/usr/local/pgsql
    --with-pdo-pgsql=shared,/usr/local/pgsql

    in the php_configure() function.

    When I then build PHP, and give the command php -m the pgsql module is not
    listed. The command php -i shows that the above options were included in
    the configure command, but does not show the pgsql module.

    In the past, I've successfully built PHP 5.2.2 with PostgreSQL 8.2.4 using
    the same steps, taking the php.SlackBuild script from /extra/source in
    Slackware 11.0, so I don't think I'm making any obvious errors.

    Also, I've googled both the web and groups, and have not found any clues.

    Has anyone else accomplished this? Any suggested avenues to investigate?

    Thanks.

  2. Re: build PHP 5.2.4 with PostgreSQL support

    joehunt1222@yahoo.com wrote:
    > I've been unable to build PHP 5.2.4 with PostgreSQL support. I have
    > PostgreSQL 8.2.4 installed.
    >
    > I've taken the php.SlackBuild from the source, modified it to include the
    > lines
    >
    > --with-pgsql=shared,/usr/local/pgsql
    > --with-pdo-pgsql=shared,/usr/local/pgsql
    >
    > in the php_configure() function.
    >
    > When I then build PHP, and give the command php -m the pgsql module is not
    > listed. The command php -i shows that the above options were included in
    > the configure command, but does not show the pgsql module.
    >
    > In the past, I've successfully built PHP 5.2.2 with PostgreSQL 8.2.4 using
    > the same steps, taking the php.SlackBuild script from /extra/source in
    > Slackware 11.0, so I don't think I'm making any obvious errors.
    >
    > Also, I've googled both the web and groups, and have not found any clues.
    >
    > Has anyone else accomplished this? Any suggested avenues to investigate?


    You are doing it right, you just missed one small point. You have built the
    PHP module "shared" (--with-pgsql=shared) which means it is not built in to
    PHP but is a loadable module. This is the right way to do it, but it means
    you need to load the module - either in your php.ini file with
    'extension=pgsql.so', or in individual scripts with "dl('pgsql.so');".
    Note that php -m shows "compiled on modules" only.

  3. Re: build PHP 5.2.4 with PostgreSQL support

    On Sun, 23 Sep 2007 02:09:42 +0000, ljb wrote:

    > joehunt1222@yahoo.com wrote:
    >> I've been unable to build PHP 5.2.4 with PostgreSQL support. I have
    >> PostgreSQL 8.2.4 installed.
    >>
    >> I've taken the php.SlackBuild from the source, modified it to include
    >> the lines
    >>
    >> --with-pgsql=shared,/usr/local/pgsql
    >> --with-pdo-pgsql=shared,/usr/local/pgsql
    >>
    >> in the php_configure() function.
    >>
    >> When I then build PHP, and give the command php -m the pgsql module is
    >> not listed. The command php -i shows that the above options were
    >> included in the configure command, but does not show the pgsql module.
    >>
    >> In the past, I've successfully built PHP 5.2.2 with PostgreSQL 8.2.4
    >> using the same steps, taking the php.SlackBuild script from
    >> /extra/source in Slackware 11.0, so I don't think I'm making any
    >> obvious errors.
    >>
    >> Also, I've googled both the web and groups, and have not found any
    >> clues.
    >>
    >> Has anyone else accomplished this? Any suggested avenues to
    >> investigate?

    >
    > You are doing it right, you just missed one small point. You have built
    > the PHP module "shared" (--with-pgsql=shared) which means it is not
    > built in to PHP but is a loadable module. This is the right way to do
    > it, but it means you need to load the module - either in your php.ini
    > file with 'extension=pgsql.so', or in individual scripts with
    > "dl('pgsql.so');". Note that php -m shows "compiled on modules" only.


    Thanks, that was the problem. I added 'extension=pgsql.so' as well as a
    line for pdo_pgsql to php.ini and now all is well.

    Joe

+ Reply to Thread