[root@centos6 httpd-2.4.29]#./configure --prefix=/app/httpd24 \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-apr=/app/apr/ \
--with-apr-util=/app/apr-util/ \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork

[root@centos6 httpd-2.4.29]#make && make install //执行此步骤是出错
已经指定了安装路径,还是出错。
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_GetErrorCode'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to
XML_SetEntityDeclHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_ParserCreate'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to
XML_SetCharacterDataHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_ParserFree'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to
XML_SetUserData'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_StopParser'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to
XML_Parse'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_ErrorString'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to
XML_SetElementHandler'
collect2: error: ld returned 1 exit status
make[2]: [htpasswd] Error 1
make[2]: Leaving directory `/usr/local/httpd-2.4.26/support'
make[1]:
[all-recursive] Error 1
make[1]: Leaving directory `/usr/local/httpd-2.4.26/support'
make: *** [all-recursive] Error 1

每次安装的时候都能出现各种不同的问题。本以为很小的问题,可是搜了好久都没找到答案。

解决办法:

网上搜的
原来是apr apr-util 用了最新的1.6版本(之前1.6版本在centos7编译安装apache没有问题)
降低了版本,用回1.5版本正常解决。
自己解决的
重新编译(以前安装过没问题,应该不是上面的问题。所以重新编译)
重要的是重新编译之后是成功的