php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32649 config.m4 change breaks --with-ibm-db2 configure option
Submitted: 2005-04-09 21:58 UTC Modified: 2005-04-10 21:24 UTC
From: dan dot scott at ca dot ibm dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 5CVS-2005-04-09 (dev) OS: Red Hat Enterprise Linux 4.0
Private report: No CVE-ID: None
 [2005-04-09 21:58 UTC] dan dot scott at ca dot ibm dot com
Description:
------------
Revision 1.70 breaks Unified ODBC compile against IBM DB2 on Linux (RHEL 4.0) if user has not sourced their DB2 environment.



Reproduce code:
---------------
Configure options:

./configure --without-sqlite --with-ibm-db2=/home/db2inst1/sqllib --with-pdo-odbc=ibm-db2,/home/db2inst1/sqllib



Expected result:
----------------
I expect configure to find the DB2 header files and libraries, have its requirements satisfied, and complete the configuration. This configure line has worked for at least five years (well, okay, drop the sqlite and pdo-odbc parts).

Actual result:
--------------
The configure command results in:

checking for IBM DB2 support... no
configure: error: build test failed. Please check the config.log for details.

config.log notes that the gconftest failed because it cannot load libdb2.so.1.

Why does this occur now? Due to the recent changes to the config.m4 file (to provide better cross-platform support), a  stricter and not at all obvious requirement has been introduced: the user must now source the DB2 environment before running ./configure.

If the user has sourced the $IBM_DB2/db2profile in their environment first, then the ./configure command succeeds. The reason is that one of the environment changes db2profile makes is to modify LD_LIBRARY_PATH and LIBPATH in the user's environment to include the DB2 libraries.

If you want to keep the current, stricter, behavior, I would strongly urge you to change the 'build test failed' message to include a suggestion along the lines of: 'Perhaps you need to source your DB2 environment: (. $IBM_DB2/db2profile) before configuring PHP.'

You could try modifying config.m4 to source the DB2 environment before attempting to compile gconftest, but that will fail if the user has pointed to /opt/IBM/db2/V8.1 instead of to a DB2 instance user.

You could also try modifying LD_LIBRARY_PATH, LIBPATH, etc. before attempting to compile gconftest -- although that will likely introduce more cross-platform issues.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-10 12:30 UTC] sniper@php.net
There is no bug here. Usually when you build something, you build it within same environment you RUN it. Some programs REQUIRE this. Before we've used flawed 'if-file-with-this-name-exist-assume-it-is-the-library' which of course won't work for everyone. 

The current behaviour is the correct one and that will not be changed. We will actually change all the places with the flawed method to use the correct one so you can expect other extensions to "break" also. (unless your LD_LIBRARY_PATH is correct)

And doesn't that IBM-DB2 add it's libline into /etc/ld.so.conf??

 [2005-04-10 16:42 UTC] dan dot scott at ca dot ibm dot com
Jani:

Hmm, can we call it a usability bug in ext/odbc/config.m4 then?

If you're changing the configure method in a way that is known to break some existing build scenarios by introducing new requirements, it would be good to communicate the change. One way to do that is to provide a more helpful error message if the user tries to compile --with-ibm-db2 but fails. Even "Try sourcing the DB2 environment first, dummy!" would be a better hint than the current message. My recommendation would be "Ensure that you have installed the DB2 application development headers (sqllib/include/sqlcli1.h), and that you have sourced the DB2 environment, before running configure again."

If tony2001 could make the requested config.m4 error message change, I would be happy to add the new requirement to the docs for Unified ODBC. That way, if the user actually reads the docs before they compile they will have a good chance of succeeding; and if they don't, and out of old habit suddenly find their configure command breaks, they will have a very good idea of how to correct the problem without having to go back to the docs.

And no, DB2 does not add itself to /etc/ld.so.conf (or the equivalent on other operating systems). Part of the install of DB2 creates a new user, the purpose of which is to contain the DB2-related settings and environment.
 [2005-04-10 21:24 UTC] sniper@php.net
Added the more detailed error message into CVS (both HEAD / PHP_5_0 branches in which the original patch was added to)

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 23 17:01:26 2019 UTC