这里报错
xml/apr_xml.c:35:19: fatal error: expat.h: 没有那个文件或目录
compilation terminated.
/etc/httpd/apr-util-1.6.0/build/rules.mk:206: recipe for target 'xml/apr_xml.lo' failed
make[1]: *** [xml/apr_xml.lo] Error 1
make[1]: Leaving directory '/etc/httpd/apr-util-1.6.0'
/etc/httpd/apr-util-1.6.0/build/rules.mk:118: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

解决办法就是安装libexpat1-dev

sudo apt-get install libexpat1-dev

 重新输

sudo make
sudo make install

在我的记录里,补充安装了libexpat1-dev 软件包后,

make clean

make 

会报错,类似于以下:

httpd-2.4.28/build/program.mk:22: recipe for target 'httpd' failed

我们正确的做法是:

#apt install libexpat1-dev

(build tree)#rm -rf ./*

(build tree)# ../configure --prefix=/usr/local/apache \
--enable-dav \
--enable-so \
--enable-maintainer-mode \
--enable-rewrite \
--enable-deflate=shared \
--enable-ssl=shared \
--enable-expires=shared \
--enable-headers=shared \
--enable-static-support \
--with-included-apr \
--with-mpm=prefork \
--enable-cache \
--enable-file-cache \

--with-pcre=/usr/local/pcre

(当然,编译选项自己选择)

(build tree)#make

(build tree)#make install

大功告成。

我所强调的重点是,补充安装缺失的软件包后,需要重新configure,然后再make && make install.


https://www.linuxidc.com/Linux/2017-08/146567.htm

https://www.cnblogs.com/zlslch/p/7136288.html

Logo

更多推荐