![更新 Apache 时遇到问题 - mod_deflate APR_INT32_MAX 未声明](https://linux22.com/image/58584/%E6%9B%B4%E6%96%B0%20Apache%20%E6%97%B6%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%20-%20mod_deflate%20APR_INT32_MAX%20%E6%9C%AA%E5%A3%B0%E6%98%8E.png)
我目前正在尝试将 apache 从 2.2.8 升级到 2.2.29,但遇到了一些麻烦。
我像这样配置了 makefile:
./configure --enable-mods-shared --enable-ssl --enable-rewrite --enable-proxy-ftp --enable-proxy-http --enable-proxy-connect --enable-proxy --enable-cache --enable-mem-cache --enable-expires --enable-hea
ders --enable-deflateloca --enable-unique-id
运行 make 命令时出现以下错误:
/usr/local/apache2/build/libtool --silent --mode=compile gcc -g -O2 -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/opt/vignette/software/apache/srclib/pcre -I. -I/opt/vignette/software/apache/os/unix -I/opt/vignette/software/apache/server/mpm/prefork -I/opt/vignette/software/apache/modules/http -I/opt/vignette/software/apache/modules/filters -I/opt/vignette/software/apache/modules/proxy -I/opt/vignette/software/apache/include -I/opt/vignette/software/apache/modules/generators -I/opt/vignette/software/apache/modules/mappers -I/opt/vignette/software/apache/modules/database -I/usr/local/apache2/include -I/opt/vignette/software/apache/modules/proxy/../generators -I/usr/kerberos/include -I/opt/vignette/software/apache/modules/ssl -I/opt/vignette/software/apache/modules/dav/main -prefer-non-pic -static -c mod_deflate.c && touch mod_deflate.lo
mod_deflate.c: In function `deflate_out_filter':
mod_deflate.c:790: error: `APR_INT32_MAX' undeclared (first use in this function)
mod_deflate.c:790: error: (Each undeclared identifier is reported only once
mod_deflate.c:790: error: for each function it appears in.)
mod_deflate.c: In function `deflate_in_filter':
mod_deflate.c:1165: error: `APR_INT32_MAX' undeclared (first use in this function)
mod_deflate.c: In function `inflate_out_filter':
mod_deflate.c:1550: error: `APR_INT32_MAX' undeclared (first use in this function)
make[3]: *** [mod_deflate.lo] Error 1
make[3]: Leaving directory `/opt/vignette/software/httpd-2.2.29/modules/filters'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/vignette/software/httpd-2.2.29/modules/filters'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/vignette/software/httpd-2.2.29/modules'
make: *** [all-recursive] Error 1
现在,当我转到 deflate.c 的第 790 行时,它有以下内容:
if (len > APR_INT32_MAX) {
apr_bucket_split(e, APR_INT32_MAX);
apr_bucket_read(e, &data, &len, APR_BLOCK_READ);
}
由于某种原因,我认为这个变量没有因为任何原因被设置。
我会注意到我正在运行 RHEL4(我知道它很糟糕)并且我最近刚刚安装了 APR(Apache 运行时)和 APU(Apache 运行时实用程序)并将它们配置为:
/usr/local/apr/bin/apr-1-config
/usr/local/apr/bin/apu-1-config
我不确定这些是否相关,或者是否会导致问题,因为我独立安装了 APR,而且它是与 apache 一起提供的。我单独安装它们的原因是因为我安装的另一个程序依赖于不同的版本。
我会说,当我配置 makefile 而不放气时,二进制文件编译成功。
答案1
经过几天的尝试,找到了解决方案。
系统上似乎安装了一个旧的 APR 库(< v1.3.0),与 apache 所需的版本冲突。我所做的是使用嵌入在 httpd-2.2.29 存档中的 APR 进行编译(并运行): ./configure --with-included-apr