我需要在 RHEL 5 上安裝 Apache 2.4 32 位元版本。
我收到“無法讀取符號”,make
這可能是由於 pcre 庫是 ELF 64 位,而安裝預計它是 ELF 32 位
**/usr/local/lib/libpcre.so: could not read symbols: File in wrong format**
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make[1]: Leaving directory `/opt/myapp/httpd-2.4.7'
make: *** [all-recursive] Error 1
Apache 2.4 的設定運作如下:
CFLAGS="-m32"; export CFLAGS
LDFLAGS="-m32"; export LDFLAGS
"./configure" \
"--prefix=/opt/myapp/apache2.4" \
"--with-mpm=worker" \
"--enable-static-support" \
"--enable-ssl=static" \
"--enable-modules=most" \
"--disable-authndbd" \
"--disable-authn-dbm" \
"--disable-dbd" \
"--enable-static-logresolve" \
"--enable-static-rotatelogs" \
"--enable-proxy=static" \
"--enable-proxyconnect=static" \
"--enable-proxy-ftp=static" \
"--enable-proxy-http=static" \
"--enable-rewrite=static" \
"--enable-so=static" \
"--with-ssl=/opt/myapp/apache2.4/openssl" \
"--host=x86_32-unknown-linux-gnu" \
"host_alias=x86_32-unknown-linux-gnu" \
"CFLAGS=-m32" \
"LDFLAGS=-m32" \
"--with-included-apr" \
"--with-pcre=/usr/local" \
"$@"
我已經安裝 PCRE,沒有任何錯誤,使用:
./configure --prefix=/usr/local --enable-pcre32
當我執行 pcretest 時,它得到這個(使用 8 位元支援編譯?):
$ /usr/local/bin/pcretest -C
PCRE version 8.33 2013-05-28
Compiled with
8-bit support
No UTF-8 support
No Unicode properties support
No just-in-time compiler support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
但是當我檢查創建的庫(應該支援 32 位元應用程式)時,我得到了 ELF 64 位元。
$ file libpcre32.so.0.0.1
libpcre32.so.0.0.1: **ELF 64-bit** LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
答案1
您的--enable_pcre32 configure
選項指的是本身的 32 位元選項pcre
(可以啟用以處理 16 位元或 32 位元版本的正規表示式 - 大概用於 Unicode 內容?)
嘗試使用您在 Apache 配置中使用的選項pcre
進行建置。-m32