我正在使用以下代码来构建 apache。
apt-get install -y git \
openssl \
subversion \
autoconf \
libtool-bin \
libapr \
libapr-util \
make \
libpcre3-dev \
libpcre++-dev \
libxml2-dev \
libnghttp2-dev\
libexpat1-dev \
libxml2-dev \
python-pip \
python-virtualenv \
python
git clone https://github.com/apache/httpd.git
cd httpd
svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr && cd srclib/apr && ./buildconf && ./configure && make && make install
出现以下错误
checking Expat 1.0/1.1... no<br/>
setting LDFLAGS to "-L/usr/local/lib"<br/>
setting INCLUDES to "-I/usr/local/include"<br/>
checking Expat 1.95.x in /usr/local... no<br/>
nulling LDFLAGS<br/>
nulling INCLUDES<br/>
setting APRUTIL_EXPORT_LIBS to ""<br/>
^[[91mconfigure: error: No XML parser found! Please specify --with-expat or --with-libxml2<br/>
有人能帮我解决这个问题吗
答案1
您可以下载此库包:
apt-get download libexpat1-dev
然后解压:
ar x libexpat1-dev_version_.deb
tar xf data.tar.gz
然后找到expat.h
头文件并将其复制到/usr/include
:
find . -name expat*.h -exec cp {} /usr/include/ \;
然后找到libexpat.so
并将其复制到/usr/lib
:
find . -name libexpat.so -exec cp {} /usr/lib/ \;
然后配置Apache
./configure
答案2
确保已经安装了 libxml2,否则使用以下命令安装
sudo apt-get install libxml2 libxml2-dev
然后在从源执行配置之前执行以下操作
./configure --with-libxml2=/usr/lib
然后执行这个命令
svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr && cd srclib/apr && ./buildconf && ./configure && make && make install
希望能帮助到你。