编译apahce时make出现/usr/local/apr-util/lib/libaprutil-

本文记录了在CentOS 6环境下使用最新版APR和APR-UTIL(1.6)编译安装Apache 2.4.29遇到的错误。详细描述了错误信息,包括libaprutil-1.so中未定义的引用。通过降低APR和APR-UTIL版本至1.5,成功解决了编译问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[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'<br/>/usr/local/apr-util/lib/libaprutil-1.so: undefined reference toXML_SetEntityDeclHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_ParserCreate'<br/>/usr/local/apr-util/lib/libaprutil-1.so: undefined reference toXML_SetCharacterDataHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_ParserFree'<br/>/usr/local/apr-util/lib/libaprutil-1.so: undefined reference toXML_SetUserData'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_StopParser'<br/>/usr/local/apr-util/lib/libaprutil-1.so: undefined reference toXML_Parse'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to XML_ErrorString'<br/>/usr/local/apr-util/lib/libaprutil-1.so: undefined reference toXML_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版本正常解决。
自己解决的
重新编译(以前安装过没问题,应该不是上面的问题。所以重新编译)
重要的是重新编译之后是成功的

转载于:https://blog.51cto.com/8564546/2338417

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值