php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40707 checking for db4 major version... Header contains different version
Submitted: 2007-03-03 15:49 UTC Modified: 2007-03-03 20:13 UTC
From: BLentz at channing-bete dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.1 OS: Multiple Linux
Private report: No CVE-ID: None
 [2007-03-03 15:49 UTC] BLentz at channing-bete dot com
Description:
------------
Operating systems: Fedora Core 5 and Aurora Linux 2.0 (Fedora Core for SPARC)
Berkeley DB versions: 4.3.29 and 4.2.52 (respectively)
Header locations: /usr/include/db.h -> /usr/include/db4/db.h
Library locations: /usr/lib/libdb.so -> /lib/libdb-4.[3|2].so
Berkeley DB installation: via RPM, including -devel packages. No other versions are installed (either via RPM or via source).

PHP_LIBDIR is being incorrectly set by the configure script as "lib64"
seems like a bad default in the absence of a user-configured value.

config.nice contains both:
'--libdir=/usr/lib64' \
and
'--with-libdir=lib64' \
even though they were not set in the ./configure line (below).

The line 27480 test can be compiled by hand using $THIS_INCLUDE=/usr/include/db.h. However, it segfaults on both systems when executed.

The line 27495 test can be run through cpp and does successfully return "yes" (DB_VERSION_MAJOR == 4).

I was ready to blame my operating system installs until I saw this on two machines/architectures... I don't know where the lib64 is coming from as it does not appear in the output of libtool --config | grep lib64, and this system is running in i386 mode, as reported by uname -a.

Reproduce code:
---------------
./configure --host=sparc-unknown-linux-gnu --build=sparc-unknown-linux-gnu --target=sparc64-redhat-linux --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --without-pear --with-bz2 --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-expat-dir=/usr --with-pcre-regex --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic=/etc/httpd/conf/magic --without-sqlite --with-libxml-dir=/usr --with-xml --enable-force-cgi-redirect --enable-pcntl --with-imap=shared --with-imap-ssl --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-ncurses=shared --with-gd=shared --enable-bcmath=shared --enable-dba=shared --with-db4 --with-xmlrpc=shared --with-ldap=shared --with-mysql=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config --enable-dom=shared --with-dom-xslt=/usr --with-dom-exslt=/usr --with-pgsql=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr --enable-xmlreader=shared --enable-xmlwriter=shared --enable-fastcgi --enable-pdo=shared --with-pdo-odbc=shared,unixODBC,/usr --with-pdo-mysql=shared,/usr --with-pdo-pgsql=shared,/usr --with-pdo-sqlite=shared,/usr --with-apxs2=/usr/sbin/apxs

Expected result:
----------------
A usable build of PHP.

If I add --libdir=/usr/lib --with-libdir=lib to the configure line, I can get one step closer to getting PHP to compile (now I'm getting "utf8_mime2text() has new signature, but U8T_CANONICAL is missing."; separate issue, I guess)

Actual result:
--------------
STDOUT:
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for db4 major version... configure: error: Header contains different version

config.log:
configure:26767: checking for QDBM support
configure:27102: checking for GDBM support
configure:27423: checking for NDBM support
configure:27528: checking for db4 major version

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-03 15:59 UTC] helly@php.net
The message 'checking for db4 major version... configure: error: Header contains different version' sounds as if you have different mahor versions of db on your system. Try "rpm -qa|grep 'db[1-4]'" to check whether you have the correct devel packages for the db version you want to use. Also check whether you are using the correct include paths.
 [2007-03-03 16:03 UTC] BLentz at channing-bete dot com
Nope. Like I said, only one version on each machine.

$ rpm -qa | grep 'db[1-4]'
db4-devel-4.3.29-8.fc5
gpg-pubkey-db42a60e-37ea5438
db4-4.3.29-8.fc5

I've fixed it with --libdir=/usr/lib --with-libdir=lib to get references to lib64 out of the script.
 [2007-03-03 20:13 UTC] BLentz at channing-bete dot com
Holy god, I'm stupid. I pity those of you who have users like myself.

I extracted the basis for my ./configure line from an existing SRPM .spec file, not wanting to stray from the distribution configuration too much. Unfortunately, the .spec has PHP4 compiling with --libdir=/usr/lib64, which is wrong. And I didn't manage to catch the error before posting a bogus bug.

Many apologies.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 21:01:29 2024 UTC