编译安装Apache遇到的缺少expat.h与undefined reference to `XML

1 缺少expat.h

编译安装Apache需要apr-util,而在编译安装apr-util时提示说缺少expat.h,此时直接安装expat库即可(centos):

yum install expat-devel

2 undefined reference to `XML_GetErrorCode'

首先安装libxml2-devel包:

yum install libxml2-devel

接着删除apr-util安装目录并重新编译安装:

sudo rm -rf /usr/local/apr-util
cd apr-util
make clean
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install

目录的话根据需要修改,最后重新编译安装apache:

cd httpd-xxxxx
make clean
./configure \
--prefix=/usr/local/apache \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr/local/pcre

同样目录按需修改。

上一篇:Redis进阶-Redis集群 【高可用切换】&【cluster-require-full-coverage】集群是否完整才能对外提供服务


下一篇:编译安装LAMP架构