Topic
  • 8 replies
  • Latest Post - ‏2006-10-16T06:34:04Z by SystemAdmin
SystemAdmin
SystemAdmin
17917 Posts

Pinned topic Unable to configure PHP with DB2

‏2006-10-09T16:37:15Z |
Hi,

This is my first time using the forums so I am not sure whether this is the correct forum to post my question to. If it is not, please point me to the forum that is.

I am trying to set up PHP 5.1.6 to work with DB2 V8.1 FP5 and IBM HTTPServer webserver on AIX 5.3.0. DB2 is installed on the server, with the instances set up and everything working well. The webserver is installed as well. When I try to run configure for PHP with the following line:

configure --without-mysql --with-ibm-db2=/home/regrdb/sqllib --with-apxs=/usr/IBM/HTTPServer/bin/apxs

I get the error:

checking for IBM DB2 support... no
configure: error:
build test failed. Please check the config.log for details.
You need to source your DB2 environment before running PHP configure:
  1. . $IBM_DB2/db2profile

So I sourced db2profile and still no luck. The only advice I found online is to source db2profile and that this occurs when PHP is unable to see the DB2 libraries. I tried dropping and recreating the instance and that did not help as well. Does anyone have any ideas on what else might be wrong?

I ran out of ideas on what else I can try so any help at all would be greatly appreciated!!

Thank you,
Diana
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-09T18:35:54Z  
    diana.barshai@gmail.com wrote:
    > Hi,
    >
    > This is my first time using the forums so I am not sure whether this is the correct forum to post my question to. If it is not, please point me to the forum that is.
    >
    > I am trying to set up PHP 5.1.6 to work with DB2 V8.1 FP5 and IBM HTTPServer webserver on AIX 5.3.0. DB2 is installed on the server, with the instances set up and everything working well. The webserver is installed as well. When I try to run configure for PHP with the following line:
    >
    > configure --without-mysql --with-ibm-db2=/home/regrdb/sqllib --with-apxs=/usr/IBM/HTTPServer/bin/apxs
    >
    > I get the error:
    >
    > checking for IBM DB2 support... no
    > configure: error:
    > build test failed. Please check the config.log for details.
    > You need to source your DB2 environment before running PHP configure:
    > # . $IBM_DB2/db2profile
    >
    > So I sourced db2profile and still no luck. The only advice I found online is to source db2profile and that this occurs when PHP is unable to see the DB2 libraries. I tried dropping and recreating the instance and that did not help as well. Does anyone have any ideas on what else might be wrong?
    >
    > I ran out of ideas on what else I can try so any help at all would be greatly appreciated!!
    Don't use the ibm-db2 module that's included with PHP. It's old and
    has issues. The new IBM_DB2 PECL module (written and supported by
    IBM) is better (and doesn't require that you recompile PHP to add
    it!).

    http://php.net/ibm_db2

  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-11T19:48:15Z  
    diana.barshai@gmail.com wrote:
    > Hi,
    >
    > This is my first time using the forums so I am not sure whether this is the correct forum to post my question to. If it is not, please point me to the forum that is.
    >
    > I am trying to set up PHP 5.1.6 to work with DB2 V8.1 FP5 and IBM HTTPServer webserver on AIX 5.3.0. DB2 is installed on the server, with the instances set up and everything working well. The webserver is installed as well. When I try to run configure for PHP with the following line:
    >
    > configure --without-mysql --with-ibm-db2=/home/regrdb/sqllib --with-apxs=/usr/IBM/HTTPServer/bin/apxs
    >
    > I get the error:
    >
    > checking for IBM DB2 support... no
    > configure: error:
    > build test failed. Please check the config.log for details.
    > You need to source your DB2 environment before running PHP configure:
    > # . $IBM_DB2/db2profile
    >
    > So I sourced db2profile and still no luck. The only advice I found online is to source db2profile and that this occurs when PHP is unable to see the DB2 libraries. I tried dropping and recreating the instance and that did not help as well. Does anyone have any ideas on what else might be wrong?
    >
    > I ran out of ideas on what else I can try so any help at all would be greatly appreciated!!
    Don't use the ibm-db2 module that's included with PHP. It's old and
    has issues. The new IBM_DB2 PECL module (written and supported by
    IBM) is better (and doesn't require that you recompile PHP to add
    it!).

    http://php.net/ibm_db2

    Hi Ian,

    Thank you so much for your response. After some digging and playing around with configure I realized that it is failing with this error:

    ould not load program ./conftest:
    Could not load module /home/regrdb/sqllib/lib/libdb2.a(shr.o).
    Dependent module /home/regrdb/sqllib/lib/libdb2osse.a(shr.o) could not be loaded.
    Member shr.o is not found in archive
    Could not load module conftest.
    Dependent module /home/regrdb/sqllib/lib/libdb2.a(shr.o) could not be loaded.
    Could not load module .

    I found some information online stating that there are some incompatibilities between the 32 and 64 bit libraries but no information on how to fix this.

    The instance regrdb is a 64 bit instance and /home/regrdb/sqllib/lib actually points to /usr/opt/db2_08_01/lib64. Both libdb2.a and libdb2osse.a are in that directory. When I run ar -X32 or -X64 <library> on both libraries I get:

    $ ar -X64 -t libdb2.a
    shr_64.o
    $ ar -X32 -t libdb2.a
    shr.o
    $ ar -X32 -t libdb2osse.a
    $ ar -X64 -t libdb2osse.a
    shr_64.o

    Any ideas?

    Thank you!
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-12T10:46:18Z  
    Hi Ian,

    Thank you so much for your response. After some digging and playing around with configure I realized that it is failing with this error:

    ould not load program ./conftest:
    Could not load module /home/regrdb/sqllib/lib/libdb2.a(shr.o).
    Dependent module /home/regrdb/sqllib/lib/libdb2osse.a(shr.o) could not be loaded.
    Member shr.o is not found in archive
    Could not load module conftest.
    Dependent module /home/regrdb/sqllib/lib/libdb2.a(shr.o) could not be loaded.
    Could not load module .

    I found some information online stating that there are some incompatibilities between the 32 and 64 bit libraries but no information on how to fix this.

    The instance regrdb is a 64 bit instance and /home/regrdb/sqllib/lib actually points to /usr/opt/db2_08_01/lib64. Both libdb2.a and libdb2osse.a are in that directory. When I run ar -X32 or -X64 <library> on both libraries I get:

    $ ar -X64 -t libdb2.a
    shr_64.o
    $ ar -X32 -t libdb2.a
    shr.o
    $ ar -X32 -t libdb2osse.a
    $ ar -X64 -t libdb2osse.a
    shr_64.o

    Any ideas?

    Thank you!
    diana.barshai@gmail.com wrote:

    > Hi Ian,
    >
    > Thank you so much for your response. After some digging and playing around
    > with configure I realized that it is failing with this error:
    >
    > ould not load program ./conftest:
    > Could not load module /home/regrdb/sqllib/lib/libdb2.a(shr.o).
    > Dependent module /home/regrdb/sqllib/lib/libdb2osse.a(shr.o) could
    > not be loaded. Member shr.o is not found in archive
    > Could not load module conftest.
    > Dependent module /home/regrdb/sqllib/lib/libdb2.a(shr.o) could not
    > be loaded.
    > Could not load module .
    >
    > I found some information online stating that there are some
    > incompatibilities between the 32 and 64 bit libraries but no information
    > on how to fix this.
    >
    > The instance regrdb is a 64 bit instance and /home/regrdb/sqllib/lib
    > actually points to /usr/opt/db2_08_01/lib64. Both libdb2.a and
    > libdb2osse.a are in that directory. When I run ar -X32 or -X64 <library>
    > on both libraries I get:
    >
    > $ ar -X64 -t libdb2.a
    > shr_64.o
    > $ ar -X32 -t libdb2.a
    > shr.o
    > $ ar -X32 -t libdb2osse.a
    > $ ar -X64 -t libdb2osse.a
    > shr_64.o
    >
    > Any ideas?

    Then you must compile PHP as 64 bit version.

    But again, don't use the PHP ODBC driver to access DB2. Stick with the IBM
    PHP module instead.

    Knut Stolze
    DB2 Information Integration Development
    IBM Germany
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-12T13:52:57Z  
    diana.barshai@gmail.com wrote:

    > Hi Ian,
    >
    > Thank you so much for your response. After some digging and playing around
    > with configure I realized that it is failing with this error:
    >
    > ould not load program ./conftest:
    > Could not load module /home/regrdb/sqllib/lib/libdb2.a(shr.o).
    > Dependent module /home/regrdb/sqllib/lib/libdb2osse.a(shr.o) could
    > not be loaded. Member shr.o is not found in archive
    > Could not load module conftest.
    > Dependent module /home/regrdb/sqllib/lib/libdb2.a(shr.o) could not
    > be loaded.
    > Could not load module .
    >
    > I found some information online stating that there are some
    > incompatibilities between the 32 and 64 bit libraries but no information
    > on how to fix this.
    >
    > The instance regrdb is a 64 bit instance and /home/regrdb/sqllib/lib
    > actually points to /usr/opt/db2_08_01/lib64. Both libdb2.a and
    > libdb2osse.a are in that directory. When I run ar -X32 or -X64 <library>
    > on both libraries I get:
    >
    > $ ar -X64 -t libdb2.a
    > shr_64.o
    > $ ar -X32 -t libdb2.a
    > shr.o
    > $ ar -X32 -t libdb2osse.a
    > $ ar -X64 -t libdb2osse.a
    > shr_64.o
    >
    > Any ideas?

    Then you must compile PHP as 64 bit version.

    But again, don't use the PHP ODBC driver to access DB2. Stick with the IBM
    PHP module instead.

    Knut Stolze
    DB2 Information Integration Development
    IBM Germany
    Is there a configure option I can specify to compile PHP as 64 bit? Or do I actually have to get a different version of PHP source? I have been searching online but have not found any clear answers.

    Thank you so much for your advice!
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-12T18:33:45Z  
    Is there a configure option I can specify to compile PHP as 64 bit? Or do I actually have to get a different version of PHP source? I have been searching online but have not found any clear answers.

    Thank you so much for your advice!
    diana.barshai@gmail.com wrote:
    > Is there a configure option I can specify to compile PHP as 64 bit?
    > Or do I actually have to get a different version of PHP source? I
    > have been searching online but have not found any clear answers.
    >

    Not sure about compiling PHP as 64-bit. However, one thing you could
    do is to create a 32-bit client instance on your machine (db2icrt -s
    client -w 32), and then compile the modules using the client
    instance instead of the server instance.
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-12T18:38:48Z  
    diana.barshai@gmail.com wrote:
    > Is there a configure option I can specify to compile PHP as 64 bit?
    > Or do I actually have to get a different version of PHP source? I
    > have been searching online but have not found any clear answers.
    >

    Not sure about compiling PHP as 64-bit. However, one thing you could
    do is to create a 32-bit client instance on your machine (db2icrt -s
    client -w 32), and then compile the modules using the client
    instance instead of the server instance.
    Ian wrote:
    > diana.barshai@gmail.com wrote:
    >> Is there a configure option I can specify to compile PHP as 64 bit?
    >> Or do I actually have to get a different version of PHP source? I
    >> have been searching online but have not found any clear answers.
    >>
    >
    > Not sure about compiling PHP as 64-bit. However, one thing you could
    > do is to create a 32-bit client instance on your machine (db2icrt -s
    > client -w 32), and then compile the modules using the client
    > instance instead of the server instance.

    Oh, and if it wasn't obvious, you'd need to continue to use this client
    instance for the PHP client -- so that means cataloging the database,
    etc.
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-14T18:29:06Z  
    Ian wrote:
    > diana.barshai@gmail.com wrote:
    >> Is there a configure option I can specify to compile PHP as 64 bit?
    >> Or do I actually have to get a different version of PHP source? I
    >> have been searching online but have not found any clear answers.
    >>
    >
    > Not sure about compiling PHP as 64-bit. However, one thing you could
    > do is to create a 32-bit client instance on your machine (db2icrt -s
    > client -w 32), and then compile the modules using the client
    > instance instead of the server instance.

    Oh, and if it wasn't obvious, you'd need to continue to use this client
    instance for the PHP client -- so that means cataloging the database,
    etc.
    Thank you so much Ian! That is what I did and PHP installed ok.

    Now I am having a different problem - I tried to catalog a local node with this command:

    catalog local node reportdb instance reportdb

    This completed successfully but now I cannot run db2start for either the instance I cataloged nor the instance I tried to catalog to. When I do db2start it takes a really long time and then comes back with:

    10/14/2006 14:16:29 0 0 SQL1042C An unexpected system error occurred.
    SQL1032N No start database manager command was issued. SQLSTATE=57019

    I uncataloged the node I tried to catalog and still the same thing is occuring. I am able to start the other instances ok.

    Any ideas?
    Thank you!!
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Unable to configure PHP with DB2

    ‏2006-10-16T06:34:04Z  
    Thank you so much Ian! That is what I did and PHP installed ok.

    Now I am having a different problem - I tried to catalog a local node with this command:

    catalog local node reportdb instance reportdb

    This completed successfully but now I cannot run db2start for either the instance I cataloged nor the instance I tried to catalog to. When I do db2start it takes a really long time and then comes back with:

    10/14/2006 14:16:29 0 0 SQL1042C An unexpected system error occurred.
    SQL1032N No start database manager command was issued. SQLSTATE=57019

    I uncataloged the node I tried to catalog and still the same thing is occuring. I am able to start the other instances ok.

    Any ideas?
    Thank you!!
    diana.barshai@gmail.com wrote:

    > Thank you so much Ian! That is what I did and PHP installed ok.
    >
    > Now I am having a different problem - I tried to catalog a local node with
    > this command:
    >
    > catalog local node reportdb instance reportdb
    >
    > This completed successfully but now I cannot run db2start for either the
    > instance I cataloged nor the instance I tried to catalog to. When I do
    > db2start it takes a really long time and then comes back with:
    >
    > 10/14/2006 14:16:29 0 0 SQL1042C An unexpected system error
    > occurred.
    > SQL1032N No start database manager command was issued. SQLSTATE=57019
    >
    > I uncataloged the node I tried to catalog and still the same thing is
    > occuring. I am able to start the other instances ok.

    What's the output of db2diag for the duration of the "db2start"?

    Knut Stolze
    DB2 Information Integration Development
    IBM Germany