php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56772 Compile Probs
Submitted: 2006-01-12 15:36 UTC Modified: 2006-10-02 15:45 UTC
From: auk100 at psu dot edu Assigned:
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 5_1 CVS-2006-01-12 OS: Debian 3.1
Private report: No CVE-ID: None
 [2006-01-12 15:36 UTC] auk100 at psu dot edu
Description:
------------
Version 1.1.6 all the way down.

./configure --with-apxs=/usr/local/apache/bin/apxs --with-gettext --with-readline --with-xml --enable-track-vars --enable-exif --enable-ftp --with-gd --with-zlib-dir=/usr/lib --with-freetype-dir=/usr/local/lib --with-openssl --with-mime-magic --with-ibm-db2 --with-IBM_DB2 --with-mysql=/usr/local/mysql --enable-mbstring=all --with-curl=/usr

Everytime I attempt to pear install or even compile PHP 5.1.2 (stable as of today) with this package I get these errors:

-prefer-non-pic -c /usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c -o ext/ibm_db2/ibm_db2.lo 
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c: In function `_php_db2_connect_helper':
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c:955: error: `SQL_ATTR_PING_DB' undeclared (first use in this function)
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c:955: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c:955: error: for each function it appears in.)
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c: In function `zif_db2_server_info':
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c:3672: error: `SQL_DATABASE_CODEPAGE' undeclared (first use in this function)
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c: In function `zif_db2_client_info':
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c:4087: error: `SQL_APPLICATION_CODEPAGE' undeclared (first use in this function)
/usr/local/src/php-5.1.2/ext/ibm_db2/ibm_db2.c:4098: error: `SQL_CONNECT_CODEPAGE' undeclared (first use in this function)
make: *** [ext/ibm_db2/ibm_db2.lo] Error 1

I have tried everything I can think of including downgrading ibm_db2 to get around this issue.

Expected result:
----------------
That it would compile or make or even install.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-12 16:06 UTC] denials at gmail dot com
The ibm_db2 extension requires DB2 V8.2 (V8.1 FixPak 7) or higher as documented at http://php.net/ibm_db2/.

Can you please confirm that you have a minimum of DB2 V8.2 / DB2 V8.1 FixPak 7 installed? Copy the results of running the "db2level" command here.

Thanks.
 [2006-01-12 16:25 UTC] denials at gmail dot com
Ah, one more thing: can you also list the files contained in /opt/IBM/db2/V8.1/include/ ?

--with-IBM_DB2 should automatically include the files in that directory, which would resolve all of the undeclared identifier errors you have listed. If that directory is empty, then it is probable that you have not installed the application development support for DB2.
 [2006-01-12 16:37 UTC] denials at gmail dot com
One final note (I promise!) -- if you are missing the DB2 headers, they are contained in the IBM_db2adt81 RPM.
 [2006-01-13 14:46 UTC] auk100 at psu dot edu
db2level reveals this:
DB21085I  Instance "db2inst1" uses "32" bits and DB2 code release "SQL08022" 
with level identifier "03030106".
Informational tokens are "DB2 v8.1.0.89", "OD_14086", "MI00105_14086", and 
FixPak "9".
Product is installed at "/opt/IBM/db2/V8.1".


I upgraded to the latest fixpack as you suggested, everything "went" smoothly until I attempted to use the function db2_connect which is as before, "Fatal error: Call to undefined function db2_connect()"

I have sourced the db2 path in both the php.ini file as well as in apache, and am now completely discouraged with the thought of ever getting this to work.
 [2006-01-13 15:23 UTC] denials at gmail dot com
Okay -- so the level of DB2 you have installed is good. You still have to successfully compile PHP with --with-IBM_DB2 support. Based on your latest error message, I imagine running "php -m" will show that ibm_db2 has not been compiled into PHP.

Next step: can you please list the files contained in
/opt/IBM/db2/V8.1/include/ ?
 [2006-01-13 15:48 UTC] auk100 at psu dot edu
You are right, php -m shows that ibm_db2 is not being compiled in even though I am specifying that it should.

My includes dir contents are as follows:
drwxr-xr-x   2 bin  bin    4096 Jan 13 13:49 cobol_mf
-r--r--r--   1 bin  bin  276847 Jun  3  2005 db2ApiDf.h
-r--r--r--   1 bin  bin   11192 Jun  3  2005 db2AuCfg.h
-r--r--r--   1 bin  bin    2797 Jun  3  2005 db2VendorApi.h
-r--r--r--   1 bin  bin    6470 Jun  3  2005 db2gse.h
-r--r--r--   1 bin  bin    7723 Jun  3  2005 db2psmd.h
-r--r--r--   1 bin  bin   25983 Jun  3  2005 db2secPlugin.h
-r--r--r--   1 bin  bin   13159 Jun  3  2005 gssapiDB2.h
-r--r--r--   1 bin  bin  121996 Jun  3  2005 sql.h
-r--r--r--   1 bin  bin    2176 Jun  3  2005 sql1252a.h
-r--r--r--   1 bin  bin    2173 Jun  3  2005 sql1252b.h
-r--r--r--   1 bin  bin    8214 Jun  3  2005 sqladef.h
-r--r--r--   1 bin  bin   86806 Jun  3  2005 sqlaprep.h
-r--r--r--   1 bin  bin    4113 Jun  3  2005 sqlca.h
-r--r--r--   1 bin  bin   26720 Jun  3  2005 sqlcli.h
-r--r--r--   1 bin  bin   57631 Jun  3  2005 sqlcli1.h
-r--r--r--   1 bin  bin  116812 Jun  3  2005 sqlcodes.h
-r--r--r--   1 bin  bin   12415 Jun  3  2005 sqlda.h
-r--r--r--   1 bin  bin    2171 Jun  3  2005 sqle819a.h
-r--r--r--   1 bin  bin    2168 Jun  3  2005 sqle819b.h
-r--r--r--   1 bin  bin    2173 Jun  3  2005 sqle850a.h
-r--r--r--   1 bin  bin    2170 Jun  3  2005 sqle850b.h
-r--r--r--   1 bin  bin    2171 Jun  3  2005 sqle932a.h
-r--r--r--   1 bin  bin    2171 Jun  3  2005 sqle932b.h
-r--r--r--   1 bin  bin  138775 Jun  3  2005 sqlenv.h
-r--r--r--   1 bin  bin   95636 Jun  3  2005 sqlext.h
-r--r--r--   1 bin  bin    9201 Jun  3  2005 sqljacb.h
-r--r--r--   1 bin  bin     630 Jun  3  2005 sqlmed.h
-r--r--r--   1 bin  bin  307565 Jun  3  2005 sqlmon.h
-r--r--r--   1 bin  bin    3145 Jun  3  2005 sqlqg_array.h
-r--r--r--   1 bin  bin  119596 Jun  3  2005 sqlqg_catalog.h
-r--r--r--   1 bin  bin   11697 Jun  3  2005 sqlqg_connection.h
-r--r--r--   1 bin  bin    2036 Jun  3  2005 sqlqg_fenced_generic_nickname.h
-r--r--r--   1 bin  bin    2043 Jun  3  2005 sqlqg_fenced_generic_server.h
-r--r--r--   1 bin  bin    1716 Jun  3  2005 sqlqg_fenced_generic_user.h
-r--r--r--   1 bin  bin    1933 Jun  3  2005 sqlqg_fenced_generic_wrapper.h
-r--r--r--   1 bin  bin    2484 Jun  3  2005 sqlqg_fenced_nickname.h
-r--r--r--   1 bin  bin    4126 Jun  3  2005 sqlqg_fenced_server.h
-r--r--r--   1 bin  bin    1293 Jun  3  2005 sqlqg_fenced_user.h
-r--r--r--   1 bin  bin    2150 Jun  3  2005 sqlqg_fenced_wrapper.h
-r--r--r--   1 bin  bin   37783 Jun  3  2005 sqlqg_misc.h
-r--r--r--   1 bin  bin    3425 Jun  3  2005 sqlqg_nickname.h
-r--r--r--   1 bin  bin   21025 Jun  3  2005 sqlqg_operation.h
-r--r--r--   1 bin  bin   14347 Jun  3  2005 sqlqg_request.h
-r--r--r--   1 bin  bin   12612 Jun  3  2005 sqlqg_runtime_data_operation.h
-r--r--r--   1 bin  bin    5969 Jun  3  2005 sqlqg_server.h
-r--r--r--   1 bin  bin    3703 Jun  3  2005 sqlqg_unfenced_generic_nickname.h
-r--r--r--   1 bin  bin    2425 Jun  3  2005 sqlqg_unfenced_generic_server.h
-r--r--r--   1 bin  bin    1703 Jun  3  2005 sqlqg_unfenced_generic_user.h
-r--r--r--   1 bin  bin    1362 Jun  3  2005 sqlqg_unfenced_generic_wrapper.h
-r--r--r--   1 bin  bin    1644 Jun  3  2005 sqlqg_unfenced_nickname.h
-r--r--r--   1 bin  bin   11131 Jun  3  2005 sqlqg_unfenced_server.h
-r--r--r--   1 bin  bin    2761 Jun  3  2005 sqlqg_unfenced_user.h
-r--r--r--   1 bin  bin    4199 Jun  3  2005 sqlqg_unfenced_wrapper.h
-r--r--r--   1 bin  bin    2629 Jun  3  2005 sqlqg_user.h
-r--r--r--   1 bin  bin    7165 Jun  3  2005 sqlqg_utils.h
-r--r--r--   1 bin  bin    5925 Jun  3  2005 sqlqg_wrapper.h
-r--r--r--   1 bin  bin   51153 Jun  3  2005 sqlstate.h
-r--r--r--   1 bin  bin    3413 Jun  3  2005 sqlsystm.h
-r--r--r--   1 bin  bin    6626 Jun  3  2005 sqlucompr.h
-r--r--r--   1 bin  bin   36851 Jun  3  2005 sqludf.h
-r--r--r--   1 bin  bin  284042 Jun  3  2005 sqlutil.h
-r--r--r--   1 bin  bin   13083 Jun  3  2005 sqluv.h
-r--r--r--   1 bin  bin   12853 Jun  3  2005 sqluvend.h
-r--r--r--   1 bin  bin   20358 Jun  3  2005 sqlxa.h
 [2006-01-13 16:16 UTC] denials at gmail dot com
Okay, that's encouraging -- you do have the header files.

Can you now try (as root):

pecl install ibm_db2

and let me know what the results are? I'm especially interested in knowing the results of the compile stage, to see if you still get those errors.
 [2006-01-13 16:30 UTC] auk100 at psu dot edu
I finally succeeded at getting it to compile properly into PHP5.1.2

Thanks for all the help! It's such a sweet package. =)
 [2006-10-02 15:35 UTC] brent dot halsey at huntington dot com
I also have this same issue where I get an error when trying to make php when I configure with IBM_DB2.  I have tried everything.  The pdo_odbc support seems to work, but I need to use it without odbc.  I have DB2 version 8.1 with fix patch 7 and also have all of the files in my include directory.  When I try to use the pecl install command, I can't because of the internet settings for this box.  Any help would be greatly appreciated.  Thanks!
 [2006-10-02 15:45 UTC] kfbombar at us dot ibm dot com
Brent,

Can you please paste the output of your environment variables, the location of your DB2 client and/or server, ./configure command, make, and make install commands?  This will help narrow the issue.  Thanks.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 13:01:52 2019 UTC