php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20928 Static compile of PHP module with IBM DB2 doesn't work right with apache
Submitted: 2002-12-10 20:11 UTC Modified: 2003-01-17 21:56 UTC
From: truth at ichaos dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.3.0 OS: RH 7.2
Private report: No CVE-ID: None
 [2002-12-10 20:11 UTC] truth at ichaos dot com
I'm trying to compile PHP as a static apache module, and I get the following error:

PATH="$PATH:/sbin" ldconfig -n /usr/src/redhat/BUILD/php-4.3.0RC2/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/src/redhat/BUILD/php-4.3.0RC2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
gcc  -Imain/ -I/usr/src/redhat/BUILD/php-4.3.0RC2/main/ -DPHP_ATOM_INC -I/usr/sr
c/redhat/BUILD/php-4.3.0RC2/include -I/usr/src/redhat/BUILD/php-4.3.0RC2/main -I
/usr/src/redhat/BUILD/php-4.3.0RC2 -I/usr/src/redhat/BUILD/php-4.3.0RC2/Zend -I/
usr/local/include -I/usr/include/imap -I/usr/src/redhat/BUILD/php-4.3.0RC2/ext/x
ml/expat  -I/usr/src/redhat/BUILD/php-4.3.0RC2/TSRM  -g -O2  -c main/internal_fu
nctions_cli.c -o main/internal_functions_cli.o  && echo > main/internal_function
s_cli.lo
/bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2  -L/home/db2inst
1/lib -rdynamic -L/usr/local/lib -L/usr/local/Informix/lib -L/usr/local/Informix
/lib/esql -L/usr/src/redhat/BUILD/php-4.3.0RC2/ext/informix  -R /usr/local/lib -
R /usr/local/Informix/lib -R /usr/local/Informix/lib/esql -R /usr/src/redhat/BUI
LD/php-4.3.0RC2/ext/informix ext/zlib/zlib.lo ext/zlib/zlib_fopen_wrapper.lo ext
/bcmath/bcmath.lo ext/bcmath/number.lo ext/bcmath/libbcmath/src/add.lo ext/bcmat
h/libbcmath/src/div.lo ext/bcmath/libbcmath/src/init.lo ext/bcmath/libbcmath/src
/neg.lo ext/bcmath/libbcmath/src/outofmem.lo ext/bcmath/libbcmath/src/raisemod.l
o ext/bcmath/libbcmath/src/rt.lo ext/bcmath/libbcmath/src/sub.lo ext/bcmath/libb
cmath/src/compare.lo ext/bcmath/libbcmath/src/divmod.lo ext/bcmath/libbcmath/src
/int2num.lo ext/bcmath/libbcmath/src/num2long.lo ext/bcmath/libbcmath/src/output
.lo ext/bcmath/libbcmath/src/recmul.lo ext/bcmath/libbcmath/src/sqrt.lo ext/bcma
th/libbcmath/src/zero.lo ext/bcmath/libbcmath/src/debug.lo ext/bcmath/libbcmath/
src/doaddsub.lo ext/bcmath/libbcmath/src/nearzero.lo ext/bcmath/libbcmath/src/nu
m2str.lo ext/bcmath/libbcmath/src/raise.lo ext/bcmath/libbcmath/src/rmzero.lo ex
t/bcmath/libbcmath/src/str2num.lo ext/ctype/ctype.lo ext/fdf/fdf.lo ext/imap/php
_imap.lo ext/informix/ifx.lo ext/ldap/ldap.lo ext/mysql/php_mysql.lo ext/mysql/l
ibmysql/libmysql.lo ext/mysql/libmysql/errmsg.lo ext/mysql/libmysql/net.lo ext/m
ysql/libmysql/violite.lo ext/mysql/libmysql/password.lo ext/mysql/libmysql/my_in
it.lo ext/mysql/libmysql/my_lib.lo ext/mysql/libmysql/my_static.lo ext/mysql/lib
mysql/my_malloc.lo ext/mysql/libmysql/my_realloc.lo ext/mysql/libmysql/my_create
.lo ext/mysql/libmysql/my_delete.lo ext/mysql/libmysql/my_tempnam.lo ext/mysql/l
ibmysql/my_open.lo ext/mysql/libmysql/mf_casecnv.lo ext/mysql/libmysql/my_read.l
o ext/mysql/libmysql/my_write.lo ext/mysql/libmysql/errors.lo ext/mysql/libmysql
/my_error.lo ext/mysql/libmysql/my_getwd.lo ext/mysql/libmysql/my_div.lo ext/mys
ql/libmysql/mf_pack.lo ext/mysql/libmysql/my_messnc.lo ext/mysql/libmysql/mf_dir
name.lo ext/mysql/libmysql/mf_fn_ext.lo ext/mysql/libmysql/mf_wcomp.lo ext/mysql
/libmysql/typelib.lo ext/mysql/libmysql/safemalloc.lo ext/mysql/libmysql/my_allo
c.lo ext/mysql/libmysql/mf_format.lo ext/mysql/libmysql/mf_path.lo ext/mysql/lib
mysql/mf_unixpath.lo ext/mysql/libmysql/my_fopen.lo ext/mysql/libmysql/mf_loadpa
th.lo ext/mysql/libmysql/my_pthread.lo ext/mysql/libmysql/my_thr_init.lo ext/mys
ql/libmysql/thr_mutex.lo ext/mysql/libmysql/mulalloc.lo ext/mysql/libmysql/strin
g.lo ext/mysql/libmysql/default.lo ext/mysql/libmysql/my_compress.lo ext/mysql/l
ibmysql/array.lo ext/mysql/libmysql/my_once.lo ext/mysql/libmysql/list.lo ext/my
sql/libmysql/my_net.lo ext/mysql/libmysql/dbug.lo ext/mysql/libmysql/strmov.lo e
xt/mysql/libmysql/strxmov.lo ext/mysql/libmysql/strnmov.lo ext/mysql/libmysql/st
rmake.lo ext/mysql/libmysql/strend.lo ext/mysql/libmysql/strfill.lo ext/mysql/li
bmysql/is_prefix.lo ext/mysql/libmysql/int2str.lo ext/mysql/libmysql/str2int.lo
ext/mysql/libmysql/strinstr.lo ext/mysql/libmysql/strcont.lo ext/mysql/libmysql/
strcend.lo ext/mysql/libmysql/bchange.lo ext/mysql/libmysql/bmove.lo ext/mysql/l
ibmysql/bmove_upp.lo ext/mysql/libmysql/longlong2str.lo ext/mysql/libmysql/strto
ull.lo ext/mysql/libmysql/strtoll.lo ext/mysql/libmysql/charset.lo ext/mysql/lib
mysql/ctype.lo ext/odbc/php_odbc.lo ext/overload/overload.lo ext/pcre/pcrelib/ma
ketables.lo ext/pcre/pcrelib/get.lo ext/pcre/pcrelib/study.lo ext/pcre/pcrelib/p
cre.lo ext/pcre/php_pcre.lo ext/pdf/pdf.lo ext/posix/posix.lo ext/session/sessio
n.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo ext/
standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/sta
ndard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_c
onvert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/st
andard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo
 ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock
.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard
/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/stand
ard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo e
xt/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/stand
ard/parsedate.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/re
g.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/st
andard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo
 ext/standard/url_scanner.lo ext/standard/var.lo ext/standard/versioning.lo ext/
standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/sta
ndard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_
wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo
ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext
/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo ext/sysvsem/s
ysvsem.lo ext/sysvshm/sysvshm.lo ext/tokenizer/tokenizer.lo ext/wddx/wddx.lo ext
/xml/xml.lo ext/xml/expat/xmlparse.lo ext/xml/expat/xmlrole.lo ext/xml/expat/xml
tok.lo regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo TSRM
/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprin
tf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers
.lo main/alloca.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content
_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo m
ain/php_variables.lo main/php_ticks.lo main/streams.lo main/network.lo main/php_
open_temporary_file.lo main/php_logos.lo main/output.lo main/memory_streams.lo m
ain/user_streams.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Z
end/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_com
pile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.
lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_opera
tors.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/ze
nd.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.
lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/
zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_execute.lo sapi/
cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -ldb2 -lcrypto
-lssl -lc-client -lifsql -lifasf -lifgen -lifos -lifgls -ldl -lcrypt -lphpifx -l
ifglx -lpdf -lz -lldap -llber -lcrypt -lpam -lfdftk -lz -lcrypt -lresolv -lm -ld
l -lnsl -lcrypt  -o sapi/cli/php
/usr/bin/ld: cannot find -ldb2
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.22825 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.22825 (%build)


======================================================
Here is the configure string:

. /home/db2inst1/sqllib/db2profile
LDFLAGS="-L/usr/IBMdb2/V7.1/lib" \
INFORMIXDIR=/usr/local/Informix \
./configure \
        --with-apache=../apache_1.3.26 \
        --prefix=/usr \
        --enable-safe-mode \
        --with-exec-dir=/usr/bin \
        --with-zlib \
        --with-config-file-path=/etc/php3/apache \
        --disable-debug \
        --enable-magic-quotes \
        --enable-debugger \
        --enable-bcmath \
        --enable-track-vars \
        --enable-trans-sid \
        --enable-wddx \
        --with-imap \
        --with-imap-ssl \
        --with-ldap \
        --with-ibm-db2=/home/db2inst1 \
        --with-system-regex \
        --with-informix=/usr/local/Informix \
        --with-pdflib=/usr/local \
        --enable-inline-optimization \
        --enable-sysvsem \
        --enable-sysvshm \
        --with-mcrypt=shared \
        --without-gd \
        --with-fdftk=/usr/local
================================================
That works fine, and compile works fine. Here is the configure on the apache:

LDFLAGS="-L/usr/IBMdb2/V7.1/lib" \
OPTIM="$RPM_OPT_FLAGS" \
SSL_BASE=../openssl-0.9.6b \
        ./configure --prefix=/usr \
        --with-layout=RedHat \
        --mandir=/usr/share/man \
        --add-module=$RPM_SOURCE_DIR/mod_bandwidth.c \
        --add-module=$RPM_SOURCE_DIR/mod_put.c \
        --activate-module=src/modules/throttle/mod_throttle.o \
        --activate-module=src/modules/php4/libphp4.a \
        --enable-module=all \
        --enable-module=ssl \
        --enable-shared=max \
        --enable-rule=EAPI \
        --disable-rule=WANTHSREGEX \
        --disable-module=auth_dbm \
        --with-perl=/usr/bin/perl \
        --enable-suexec \
        --suexec-docroot=/home/httpd/html \
        --suexec-caller=nobody

=========================================
The problem occurs after I type "make" in the apache directory.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-11 00:24 UTC] sniper@php.net
You're passing the configure a different path to the DB2 install directory and then you set LDFLAGS to something else. Not PHP bug, user error.

 [2002-12-11 00:43 UTC] truth at ichaos dot com
I actually added the LDFLAGS myself to try and get things to start working. When you set up an instance (called db2inst1), it creates symbolic links in the instance directory to the /usr/IBMdb2/V7.1 directory for all the commands, libraries, and utilities. So LDFLAGS can be set to either, it really doesn't matter.
 [2002-12-11 00:46 UTC] truth at ichaos dot com
BTW, when I look at the command that compiles apache, it is clearly missing the -L/home/db2inst1/sqllib/lib in the list of library paths. This is the reason it's failing. I don't know how to add that path so that make in the apache dir will pick it up properly.
 [2002-12-11 00:48 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-12-11 01:22 UTC] truth at ichaos dot com
It got much further this time, but results are the same. Here is the paste of the last command and error:

<=== src/modules/throttle
===> src/modules/php4
gcc -c  -I../../os/unix -I../../include  -O2 -march=i386 -mcpu=i686 -DLINUX=22 -
I/usr/include/db1 -DMOD_SSL=208110 -DEAPI `../../apaci` -fpic -DSHARED_MODULE -D
LINUX=22 -I/usr/include/db1 -DMOD_SSL=208110  -I/usr/src/redhat/BUILD/php4-20021
2110630/main -I/usr/src/redhat/BUILD/php4-200212110630/Zend -I/usr/src/redhat/BU
ILD/php4-200212110630/TSRM -I/usr/src/redhat/BUILD/php4-200212110630 -I/usr/src/
redhat/BUILD/php4-200212110630/sapi/apache -I/usr/src/redhat/BUILD/php4-20021211
0630/main -I/usr/src/redhat/BUILD/php4-200212110630/Zend -I/usr/src/redhat/BUILD
/php4-200212110630/TSRM   mod_php4.c && mv mod_php4.o mod_php4.so-o
rm -f libphp4.so
gcc -shared -o libphp4.so mod_php4.so-o libmodphp4.a  -Wl,-rpath,/usr/local/lib
-Wl,-rpath,/usr/local/Informix/lib -Wl,-rpath,/usr/local/Informix/lib/esql -Wl,-
rpath,/usr/src/redhat/BUILD/php4-200212110630/ext/informix  -rdynamic -rdynamic
-L/usr/local/lib -L/usr/local/Informix/lib -L/usr/local/Informix/lib/esql -L/usr
/src/redhat/BUILD/php4-200212110630/ext/informix -Lmodules/php4 -L../modules/php
4 -L../../modules/php4 -lmodphp4  -ldb2 -lcrypto -lssl -lc-client  -lifsql -lifa
sf -lifgen -lifos -lifgls -ldl -lcrypt -lphpifx -lifglx -lpdf -lz -lldap -llber
-lcrypt -lpam -lfdftk -lz -lcrypt -lresolv -lm -ldl -lnsl  -lcrypt   -lm -lcrypt
 -ldb1 -ldb -lexpat -ldl -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/local/Informi
x/lib -Wl,-rpath,/usr/local/Informix/lib/esql -Wl,-rpath,/usr/src/redhat/BUILD/p
hp4-200212110630/ext/informix  -rdynamic -rdynamic -L/usr/local/lib -L/usr/local
/Informix/lib -L/usr/local/Informix/lib/esql -L/usr/src/redhat/BUILD/php4-200212
110630/ext/informix -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodp
hp4  -ldb2 -lcrypto -lssl -lc-client  -lifsql -lifasf -lifgen -lifos -lifgls -ld
l -lcrypt -lphpifx -lifglx -lpdf -lz -lldap -llber -lcrypt -lpam -lfdftk -lz -lc
rypt -lresolv -lm -ldl -lnsl  -lcrypt   -lm -lcrypt -ldb1 -ldb
/usr/bin/ld: cannot find -ldb2
collect2: ld returned 1 exit status
make[4]: *** [libphp4.so] Error 1
make[3]: *** [all] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/usr/src/redhat/BUILD/apache_1.3.26/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/apache_1.3.26'
make: *** [build] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.89498 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.89498 (%build)
 [2002-12-11 02:42 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2002-12-11 10:45 UTC] truth at ichaos dot com
Fixed in which snapshot release? Just tried 4.3.x-dev and it's still broken:

===> src/modules/php4
gcc -c  -I../../os/unix -I../../include  -O2 -march=i386 -mcpu=i686 -DLINUX=22 -
I/usr/include/db1 -DMOD_SSL=208110 -DEAPI `../../apaci` -fpic -DSHARED_MODULE -D
LINUX=22 -I/usr/include/db1 -DMOD_SSL=208110  -I/usr/src/redhat/BUILD/php4-STABL
E-200212111430/main -I/usr/src/redhat/BUILD/php4-STABLE-200212111430/Zend -I/usr
/src/redhat/BUILD/php4-STABLE-200212111430/TSRM -I/usr/src/redhat/BUILD/php4-STA
BLE-200212111430 -I/usr/src/redhat/BUILD/php4-STABLE-200212111430/sapi/apache -I
/usr/src/redhat/BUILD/php4-STABLE-200212111430/main -I/usr/src/redhat/BUILD/php4
-STABLE-200212111430/Zend -I/usr/src/redhat/BUILD/php4-STABLE-200212111430/TSRM
  mod_php4.c && mv mod_php4.o mod_php4.so-o
rm -f libphp4.so
gcc -shared -o libphp4.so mod_php4.so-o libmodphp4.a  -Wl,-rpath,/usr/local/lib
-Wl,-rpath,/usr/local/Informix/lib -Wl,-rpath,/usr/local/Informix/lib/esql -Wl,-
rpath,/usr/src/redhat/BUILD/php4-STABLE-200212111430/ext/informix  -rdynamic -L/
usr/local/lib -L/usr/local/Informix/lib -L/usr/local/Informix/lib/esql -L/usr/sr
c/redhat/BUILD/php4-STABLE-200212111430/ext/informix -Lmodules/php4 -L../modules
/php4 -L../../modules/php4 -lmodphp4  -L/home/db2inst1/lib   -rdynamic -L/usr/lo
cal/lib -L/usr/local/Informix/lib -L/usr/local/Informix/lib/esql -L/usr/src/redh
at/BUILD/php4-STABLE-200212111430/ext/informix  -ldb2 -lcrypto -lssl -lc-client
 -lifsql -lifasf -lifgen -lifos -lifgls -ldl -lcrypt -lphpifx -lifglx -lpdf -lz
-lldap -llber -lcrypt -lpam -lfdftk -lz -lcrypt -lresolv -lm -ldl -lnsl  -lcrypt
   -lm -lcrypt -ldb1 -ldb -lexpat -ldl -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr
/local/Informix/lib -Wl,-rpath,/usr/local/Informix/lib/esql -Wl,-rpath,/usr/src/
redhat/BUILD/php4-STABLE-200212111430/ext/informix  -rdynamic -L/usr/local/lib -
L/usr/local/Informix/lib -L/usr/local/Informix/lib/esql -L/usr/src/redhat/BUILD/
php4-STABLE-200212111430/ext/informix -Lmodules/php4 -L../modules/php4 -L../../m
odules/php4 -lmodphp4  -L/home/db2inst1/lib   -rdynamic -L/usr/local/lib -L/usr/
local/Informix/lib -L/usr/local/Informix/lib/esql -L/usr/src/redhat/BUILD/php4-S
TABLE-200212111430/ext/informix  -ldb2 -lcrypto -lssl -lc-client  -lifsql -lifas
f -lifgen -lifos -lifgls -ldl -lcrypt -lphpifx -lifglx -lpdf -lz -lldap -llber -
lcrypt -lpam -lfdftk -lz -lcrypt -lresolv -lm -ldl -lnsl  -lcrypt   -lm -lcrypt
-ldb1 -ldb
/usr/bin/ld: cannot find -ldb2
collect2: ld returned 1 exit status
make[4]: *** [libphp4.so] Error 1
make[3]: *** [all] Error 1
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/usr/src/redhat/BUILD/apache_1.3.26/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/apache_1.3.26'
make: *** [build] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.86132 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.86132 (%build)
 [2002-12-11 12:46 UTC] truth at ichaos dot com
This is still broken, I used the PHP4.3.x_dev snapshot.
 [2002-12-11 17:09 UTC] sniper@php.net
Please try newer snapshot and with CLEAN apache sources.

 [2002-12-11 17:11 UTC] sniper@php.net
And note that the libpath is there now..but most likely the library (like I suspected earlier) is not there.

 [2002-12-19 19:59 UTC] truth at ichaos dot com
The latest snapshot yields this error when compiling PHP:

gcc  -Isapi/cli/ -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cli/ -DPH
P_ATOM_INC -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/include -I/usr/src/r
edhat/BUILD/php4-STABLE-200212200030/main -I/usr/src/redhat/BUILD/php4-STABLE-20
0212200030 -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/Zend -I/usr/local/in
clude -I/usr/include/imap -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/ext/x
ml/expat  -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/TSRM  -g -O2  -c /usr
/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cli/php_cli.c -o sapi/cli/php_cl
i.o  && echo > sapi/cli/php_cli.lo
gcc  -Isapi/cli/ -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cli/ -DPH
P_ATOM_INC -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/include -I/usr/src/r
edhat/BUILD/php4-STABLE-200212200030/main -I/usr/src/redhat/BUILD/php4-STABLE-20
0212200030 -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/Zend -I/usr/local/in
clude -I/usr/include/imap -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/ext/x
ml/expat  -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/TSRM  -g -O2  -c /usr
/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cli/getopt.c -o sapi/cli/getopt.
o  && echo > sapi/cli/getopt.lo
gcc  -Imain/ -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/main/ -DPHP_ATOM_I
NC -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/include -I/usr/src/redhat/BU
ILD/php4-STABLE-200212200030/main -I/usr/src/redhat/BUILD/php4-STABLE-2002122000
30 -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/Zend -I/usr/local/include -I
/usr/include/imap -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/ext/xml/expat
  -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/TSRM  -g -O2  -c main/interna
l_functions_cli.c -o main/internal_functions_cli.o  && echo > main/internal_func
tions_cli.lo
/bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2  -L/home/db2inst
1/lib -rdynamic -L/usr/local/lib -L/usr/local/Informix/lib -L/usr/local/Informix
/lib/esql -L/usr/src/redhat/BUILD/php4-STABLE-200212200030/ext/informix  -R /usr
/local/lib -R /usr/local/Informix/lib -R /usr/local/Informix/lib/esql -R /usr/sr
c/redhat/BUILD/php4-STABLE-200212200030/ext/informix ext/zlib/zlib.lo ext/zlib/z
lib_fopen_wrapper.lo ext/bcmath/bcmath.lo ext/bcmath/number.lo ext/bcmath/libbcm
ath/src/add.lo ext/bcmath/libbcmath/src/div.lo ext/bcmath/libbcmath/src/init.lo
ext/bcmath/libbcmath/src/neg.lo ext/bcmath/libbcmath/src/outofmem.lo ext/bcmath/
libbcmath/src/raisemod.lo ext/bcmath/libbcmath/src/rt.lo ext/bcmath/libbcmath/sr
c/sub.lo ext/bcmath/libbcmath/src/compare.lo ext/bcmath/libbcmath/src/divmod.lo
ext/bcmath/libbcmath/src/int2num.lo ext/bcmath/libbcmath/src/num2long.lo ext/bcm
ath/libbcmath/src/output.lo ext/bcmath/libbcmath/src/recmul.lo ext/bcmath/libbcm
ath/src/sqrt.lo ext/bcmath/libbcmath/src/zero.lo ext/bcmath/libbcmath/src/debug.
lo ext/bcmath/libbcmath/src/doaddsub.lo ext/bcmath/libbcmath/src/nearzero.lo ext
/bcmath/libbcmath/src/num2str.lo ext/bcmath/libbcmath/src/raise.lo ext/bcmath/li
bbcmath/src/rmzero.lo ext/bcmath/libbcmath/src/str2num.lo ext/ctype/ctype.lo ext
/fdf/fdf.lo ext/imap/php_imap.lo ext/informix/ifx.lo ext/ldap/ldap.lo ext/mysql/
php_mysql.lo ext/mysql/libmysql/libmysql.lo ext/mysql/libmysql/errmsg.lo ext/mys
ql/libmysql/net.lo ext/mysql/libmysql/violite.lo ext/mysql/libmysql/password.lo
ext/mysql/libmysql/my_init.lo ext/mysql/libmysql/my_lib.lo ext/mysql/libmysql/my
_static.lo ext/mysql/libmysql/my_malloc.lo ext/mysql/libmysql/my_realloc.lo ext/
mysql/libmysql/my_create.lo ext/mysql/libmysql/my_delete.lo ext/mysql/libmysql/m
y_tempnam.lo ext/mysql/libmysql/my_open.lo ext/mysql/libmysql/mf_casecnv.lo ext/
mysql/libmysql/my_read.lo ext/mysql/libmysql/my_write.lo ext/mysql/libmysql/erro
rs.lo ext/mysql/libmysql/my_error.lo ext/mysql/libmysql/my_getwd.lo ext/mysql/li
bmysql/my_div.lo ext/mysql/libmysql/mf_pack.lo ext/mysql/libmysql/my_messnc.lo e
xt/mysql/libmysql/mf_dirname.lo ext/mysql/libmysql/mf_fn_ext.lo ext/mysql/libmys
ql/mf_wcomp.lo ext/mysql/libmysql/typelib.lo ext/mysql/libmysql/safemalloc.lo ex
t/mysql/libmysql/my_alloc.lo ext/mysql/libmysql/mf_format.lo ext/mysql/libmysql/
mf_path.lo ext/mysql/libmysql/mf_unixpath.lo ext/mysql/libmysql/my_fopen.lo ext/
mysql/libmysql/mf_loadpath.lo ext/mysql/libmysql/my_pthread.lo ext/mysql/libmysq
l/my_thr_init.lo ext/mysql/libmysql/thr_mutex.lo ext/mysql/libmysql/mulalloc.lo
ext/mysql/libmysql/string.lo ext/mysql/libmysql/default.lo ext/mysql/libmysql/my
_compress.lo ext/mysql/libmysql/array.lo ext/mysql/libmysql/my_once.lo ext/mysql
/libmysql/list.lo ext/mysql/libmysql/my_net.lo ext/mysql/libmysql/dbug.lo ext/my
sql/libmysql/strmov.lo ext/mysql/libmysql/strxmov.lo ext/mysql/libmysql/strnmov.
lo ext/mysql/libmysql/strmake.lo ext/mysql/libmysql/strend.lo ext/mysql/libmysql
/strfill.lo ext/mysql/libmysql/is_prefix.lo ext/mysql/libmysql/int2str.lo ext/my
sql/libmysql/str2int.lo ext/mysql/libmysql/strinstr.lo ext/mysql/libmysql/strcon
t.lo ext/mysql/libmysql/strcend.lo ext/mysql/libmysql/bchange.lo ext/mysql/libmy
sql/bmove.lo ext/mysql/libmysql/bmove_upp.lo ext/mysql/libmysql/longlong2str.lo
ext/mysql/libmysql/strtoull.lo ext/mysql/libmysql/strtoll.lo ext/mysql/libmysql/
charset.lo ext/mysql/libmysql/ctype.lo ext/odbc/php_odbc.lo ext/overload/overloa
d.lo ext/pcre/pcrelib/maketables.lo ext/pcre/pcrelib/get.lo ext/pcre/pcrelib/stu
dy.lo ext/pcre/pcrelib/pcre.lo ext/pcre/php_pcre.lo ext/pdf/pdf.lo ext/posix/pos
ix.lo ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/
session/mod_user.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/ba
sic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/cry
pt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo e
xt/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo
ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_pri
nt.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standa
rd/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/st
andard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext
/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standa
rd/pageinfo.lo ext/standard/parsedate.lo ext/standard/quot_print.lo ext/standard
/rand.lo ext/standard/reg.lo ext/standard/soundex.lo ext/standard/string.lo ext/
standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqi
d.lo ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo ext/sta
ndard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standar
d/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo
 ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standa
rd/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard
/var_unserializer.lo ext/standard/ftok.lo ext/standard/aggregation.lo ext/standa
rd/sha1.lo ext/sysvsem/sysvsem.lo ext/sysvshm/sysvshm.lo ext/tokenizer/tokenizer
.lo ext/wddx/wddx.lo ext/xml/xml.lo ext/xml/expat/xmlparse.lo ext/xml/expat/xmlr
ole.lo ext/xml/expat/xmltok.lo regex/regcomp.lo regex/regexec.lo regex/regerror.
lo regex/regfree.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo
main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mod
e.lo main/fopen_wrappers.lo main/alloca.lo main/php_ini.lo main/SAPI.lo main/rfc
1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort
.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/streams.lo m
ain/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo
main/memory_streams.lo main/user_streams.lo Zend/zend_language_parser.lo Zend/ze
nd_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zen
d_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.l
o Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_o
pcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/z
end_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend
_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Ze
nd/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Ze
nd/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_function
s_cli.lo -ldb2 -lcrypto -lssl -lc-client -lifsql -lifasf -lifgen -lifos -lifgls
-ldl -lcrypt -lphpifx -lifglx -lpdf -lz -lldap -llber -lcrypt -lpam -lfdftk -lz
-lcrypt -lresolv -lm -ldl -lnsl -lcrypt  -o sapi/cli/php
/usr/bin/ld: cannot find -ldb2
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.41745 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.41745 (%build)
 [2003-01-16 10:53 UTC] kalowsky@php.net
This isn't an ODBC issue per say, but rather a compile issue.  Moving this to the compile category.  Also updating version.
 [2003-01-17 20:30 UTC] sniper@php.net
One thing I forgot to ask: Does it work if you compile PHP as DSO ? (--with-apxs)

And try this too:

# rm config.cache
# ./configure --with-ibm-db2=/home/db2inst1 --disable-all
# make


 [2003-01-17 20:46 UTC] truth at ichaos dot com
I havn't been able to get it to work at all as a DSO as something conflicts with mod_ssl and apache crashes.
 [2003-01-17 20:49 UTC] sniper@php.net
So it does COMPILE fine when you compile PHP as DSO?
Did you try the configure line I gave?

 [2003-01-17 21:26 UTC] truth at ichaos dot com
I noticed that you do /home/db2inst1/lib...All DB2 instance home directories have "sqllib" as a subdirectory which "lib" is located in. You will want to add that to configure so that if someone says --with-ibm-db2=/home/db2inst1, it knows that everything is under /home/db2inst1/sqllib (include dirs, lib dirs, etc.). Thats how it used to work anyway. It must have gotten changed at some point.

Nope, I get the following after "make":

[root@voyager php4-STABLE-200212200030]# make
gcc -I -Isapi/cgi/ -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cgi/ -DPHP_ATOM_INC -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/include -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/main -I/usr/src/redhat/BUILD/php4-STABLE-200212200030 -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/Zend  -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/TSRM  -g -O2  -c /usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cgi/cgi_main.c -o sapi/cgi/cgi_main.o  && echo > sapi/cgi/cgi_main.lo
/usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cgi/cgi_main.c: In function `main':
/usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cgi/cgi_main.c:1000: warning: passing arg 2 of `cfg_get_long' from incompatible pointer type
gcc -I -Isapi/cgi/ -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cgi/ -DPHP_ATOM_INC -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/include -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/main -I/usr/src/redhat/BUILD/php4-STABLE-200212200030 -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/Zend  -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/TSRM  -g -O2  -c /usr/src/redhat/BUILD/php4-STABLE-200212200030/sapi/cgi/getopt.c -o sapi/cgi/getopt.o  && echo > sapi/cgi/getopt.lo
gcc  -Imain/ -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/main/ -DPHP_ATOM_INC -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/include -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/main -I/usr/src/redhat/BUILD/php4-STABLE-200212200030 -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/Zend  -I/usr/src/redhat/BUILD/php4-STABLE-200212200030/TSRM  -g -O2  -c main/internal_functions.c -o main/internal_functions.o  && echo > main/internal_functions.lo
/bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2  -L/home/db2inst1/lib   ext/odbc/php_odbc.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/streams.lo main/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo main/memory_streams.lo main/user_streams.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_execute.lo sapi/cgi/cgi_main.lo sapi/cgi/getopt.lo main/internal_functions.lo -ldb2 -lcrypt -lresolv -lm -ldl -lnsl -lcrypt  -o sapi/cgi/php
/usr/bin/ld: cannot find -ldb2
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1
[root@voyager php4-STABLE-200212200030]#

=================================
[root@voyager php4-STABLE-200212200030]# ls /home/db2inst1/sqllib/lib/
db2fs.jar      libcatcp.a        libdb2jwsup.so    libdb2sqlj.so
db2fsmri.jar   libdb2apie.so     libdb2jwsup.so.1  libddcs.a
db2fstep       libdb2apie.so.1   libdb2licm.so     libdfcm.a
db2jddba       libdb2ar.so       libdb2licm.so.1   libdpdcf.a
db2jrt         libdb2ccai.so.1   libdb2psmd.so     libdrda.so
db2mkrts.args  libdb2ccsup.so.1  libdb2psmd.so.1   libibmosse.so
db2rexx        libdb2e.so.1      libdb2qp.so       libibmosse.so.1
db2scedu       libdb2gmf.a       libdb2scedu.so.1  libmsrvs.so.1
libadsm.a      libdb2jdbc.so     libdb2si.so.1
libasnlib.a    libdb2jdsup.so.1  libdb2.so
libcapro.so.1  libdb2jext.so     libdb2.so.1
 [2003-01-17 21:56 UTC] sniper@php.net
Uh..please DO NOT PASTE that much. You can easily cut off
some..

This will work:

# ./configure --with-ibm-db2=/home/db2inst1/sqllib/ --disable-all

Or 

# ./configure --with-ibm-db2

Not a bug.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 20:01:27 2024 UTC