Apache-Httpd
更新 Apache 時遇到問題 - mod_deflate APR_INT32_MAX 未聲明
我目前正在嘗試將 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 而不放氣時,二進制編譯成功。
經過幾天的嘗試,這裡是解決方案。
系統上似乎安裝了一個舊的 APR 庫 (< v1.3.0),它與 apache 所需的版本衝突。我所做的是使用嵌入在 httpd-2.2.29 存檔中的 APR 編譯(並執行):./configure –with-included-apr