【问题标题】:checking for DB4 major version... configure: error: Header contains different version检查 DB4 主要版本...配置:错误:标头包含不同的版本
【发布时间】:2025-12-10 01:55:01
【问题描述】:

我一直在尝试使用以下 ./configure 编译 PHP

[./configure]

`CC="gcc -m64" ./configure \
  --prefix=/opt/php-5.3.14 \
  --with-apxs2=/opt/apache-httpd-2.2.22/bin/apxs \
  --enable-mbstring \
  --enable-intl \
  --libdir=/usr/lib \
  --with-icu-dir=/usr \
  --with-gettext=/usr \
  --with-pcre-regex=/opt/pcre-8.35 \
  --with-pcre-dir=/opt/pcre-8.35 \
  --with-readline=/usr \
  --with-libxml-dir=/usr/bin/xml2-config \
  --enable-soap \
  --enable-wddx \
  --with-xmlrpc \
  --with-xsl=/usr \
  --with-mysql=mysqlnd \
  --with-mysqli=mysqlnd \
  --with-pdo-mysql=mysqlnd \
  --enable-dba \
  --with-db4=/usr \
  --with-zlib=/opt/zlib-1.2.8 \
  --with-zlib-dir=/opt/zlib-1.2.8 \
  --with-gd \
  --with-jpeg-dir=/usr \
  --with-png-dir=/usr \
  --with-freetype-dir=/usr \
  --enable-gd-native-ttf \
  --enable-gd-jis-conv \
  --with-mcrypt=/usr \
  --enable-bcmath \
  --with-openssl=/opt/openssl-1.0.0g \
2>&1 | tee configure_log.txt`

我有消息checking for DB4 major version... configure: error: Header contains different version

告诉我如何解决这个问题。

db4的包如下。

# rpm -qa|grep db4
db4-devel-4.7.25-18.el6_4.x86_64
db4-cxx-4.7.25-18.el6_4.x86_64
db4-4.7.25-18.el6_4.x86_64
db4-utils-4.7.25-18.el6_4.x86_64
#

【问题讨论】:

    标签: php configuration compilation berkeley-db


    【解决方案1】:

    您似乎同时安装了 db4 和 db5,并且 /usr/include/db.h 不是来自 db-4.7.25。

    尝试将 -I/usr/include/db47 添加到 CFLAGS 以便 /usr/include/db47/db.h 在 /usr/include/db.h 之前找到

    【讨论】:

      最近更新 更多