apache編譯故障-apr-not-found.docx

安裝apacheapr not found報錯

安裝Apache的步驟

# 下載httpd-2.2.23.tar.gz安裝包

# tar zxvfhttpd-2.2.23.tar.gz

# cd httpd-2.2.23

# ./configure--prefix=/usr/local/apache2

# make && makeinstall

在安裝過程中,執行./configure --prefix=/usr/local/apache2後出現報錯信息如下:

configure: error: APR not found . Please readthe documentation

解決辦法:

1、首先需要下載三個軟件包

     wgethttp://archive.apache.org/dist/apr/apr-1.4.5.tar.gz  

     wgethttp://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz  

     wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

1)、第一步解決“apr not found

   #tar zxvf apr-1.4.5.tar.gz

    #./configure –prefix=/use/local/apr

    #make&&makeinstall

2)、第二步解決“apr-utilnot found

    # tar -zxfapr-util-1.3.12.tar.gz  

# cd apr-util-1.3.12  

#./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config  

# make && make install

     3)、第三步解決pcre問題

          #unzip -opcre-8.10.zip  

#cd pcre-8.10  

#./configure --prefix=/usr/local/pcre  

#make && make install

如果出現報錯信息,以上解決步驟缺一不可

<1>、在安裝pcre的時候可能遇到的問題:“libtool: line 990: g++: command not found

解決辦法:安裝gcc-c++    

     #yum install gcc-c++

在安裝gcc-g++後我們繼續makeg++問題解決了但是出現以下錯誤

         ibtool: link: Fatalconfigurationerror.

         make[1]: *** [libpcrecpp.la] 錯誤 1

         make[1]: Leaving directory `/usr/app/pcre-8.00'

         make: *** [all] 錯誤 2

現在我們需要操作的就是重新./configure並且make,如果問題依然沒有得到解決並報錯

/usr/bin/ld: .libs/pcrecpp.o: relocationR_X86_64_32S against `.bss'can not be used when making a shared object;recompile with -fPIC

.libs/pcrecpp.o:couldnot read symbols: Bad value

collect2: ld returned 1exit status

make[1]: ***[libpcrecpp.la] 錯誤 1

make[1]: Leaving directory`/usr/app/pcre-8.00'

make: *** [all] 錯誤 2

這次解決的辦法是在配置的時候添加“--disable-shared --with-pic

# ./configure –prefix=/use/local/pcre –disable-shared–with-pic

以上問題都解決後我們可以繼續安裝apache了,在編譯的時候我們需要加上“--with-apr=/usr/local/apr  --with-apr-util=/usr/local/apr-util  --with-pcre=/usr/local/pcre

#./configure–prefix=/use/local/apache2 --with-apr=/usr/local/apr  --with-apr-util=/usr/local/apr-util  --with-pcre=/usr/local/pcre


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章