首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >为什么在编译Apache2时使用'make‘会返回“目标'httpd’的配方失败”,我该如何修复它?

为什么在编译Apache2时使用'make‘会返回“目标'httpd’的配方失败”,我该如何修复它?
EN

Stack Overflow用户
提问于 2016-08-21 18:41:49
回答 1查看 2.7K关注 0票数 0

lsb_release:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial

我正在尝试安装Apache2,并且正在努力编译源代码。我已经成功地对其进行了配置,但是当我使用'make‘时,它会响应"recipe for target 'httpd’failed“。下面是在底部使用'make‘相关信息的完整输出。我想知道为什么会发生这种情况,以及我如何防止这种情况发生。谢谢!

jack@jw-xubuntu-desk1:~/Documents/apache/httpd-2.4.23$ make
Making all in srclib
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/srclib'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/srclib'
Making all in os
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/os'
Making all in unix
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[3]: Nothing to be done for 'local-all'.
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/os/unix'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/os'
Making all in server
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server'
Making all in mpm
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm'
Making all in event
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[4]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[4]: Nothing to be done for 'local-all'.
make[4]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm/event'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server/mpm'
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/server'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/server'
Making all in modules
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules'
Making all in aaa
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/aaa'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/aaa'
Making all in cache
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/cache'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/cache'
Making all in core
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
make[3]: Nothing to be done for 'local-all'.
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/core'
Making all in database
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/database'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/database'
Making all in debugging
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/debugging'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/debugging'
Making all in filters
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/filters'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/filters'
Making all in http
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
make[3]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
make[3]: Nothing to be done for 'local-all'.
make[3]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/http'
Making all in ldap
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ldap'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ldap'
Making all in loggers
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/loggers'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/loggers'
Making all in metadata
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/metadata'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/metadata'
Making all in proxy
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy'
Making all in session
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/session'
make[2]: Leaving directory '/home/jack/DoThankyou!cuments/apache/httpd-2.4.23/modules/session'
Making all in slotmem
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/slotmem'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/slotmem'
Making all in ssl
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ssl'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/ssl'
Making all in proxy/balancers
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy/balancers'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/proxy/balancers'
Making all in arch/unix
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/arch/unix'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/arch/unix'
Making all in dav/main
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/main'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/main'
Making all in generators
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/generators'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/generators'
Making all in dav/fs
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/fs'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/dav/fs'
Making all in mappers
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/modules/mappers'
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules/mappers'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/modules'
Making all in support
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[2]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[2]: Nothing to be done for 'local-all'.
make[2]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23/support'
make[1]: Entering directory '/home/jack/Documents/apache/httpd-2.4.23'
x86_64-linux-gnu-gcc  -pthread      -DLINUX -D_REENTRANT -D_GNU_SOURCE     -I. -I/home/jack/Documents/apache/httpd-2.4.23/os/unix -I/home/jack/Documents/apache/httpd-2.4.23/include -I/usr/include/apr-1.0 -I/usr/include -I/usr/local/pcre/include -I/home/jack/Documents/apache/httpd-2.4.23/modules/aaa -I/home/jack/Documents/apache/httpd-2.4.23/modules/cache -I/home/jack/Documents/apache/httpd-2.4.23/modules/core -I/home/jack/Documents/apache/httpd-2.4.23/modules/database -I/home/jack/Documents/apache/httpd-2.4.23/modules/filters -I/home/jack/Documents/apache/httpd-2.4.23/modules/ldap -I/home/jack/Documents/apache/httpd-2.4.23/modules/loggers -I/home/jack/Documents/apache/httpd-2.4.23/modules/lua -I/home/jack/Documents/apache/httpd-2.4.23/modules/proxy -I/home/jack/Documents/apache/httpd-2.4.23/modules/session -I/home/jack/Documents/apache/httpd-2.4.23/modules/ssl -I/home/jack/Documents/apache/httpd-2.4.23/modules/test -I/home/jack/Documents/apache/httpd-2.4.23/server -I/home/jack/Documents/apache/httpd-2.4.23/modules/arch/unix -I/home/jack/Documents/apache/httpd-2.4.23/modules/dav/main -I/home/jack/Documents/apache/httpd-2.4.23/modules/generators -I/home/jack/Documents/apache/httpd-2.4.23/modules/mappers  -c /home/jack/Documents/apache/httpd-2.4.23/server/buildmark.c
/usr/share/apr-1.0/build/libtool --silent --mode=link x86_64-linux-gnu-gcc  -pthread         -o httpd  modules.lo buildmark.o -export-dynamic server/libmain.la modules/core/libmod_so.la modules/http/libmod_http.la server/mpm/event/libevent.la os/unix/libos.la      /usr/lib/x86_64-linux-gnu/libaprutil-1.la /usr/lib/x86_64-linux-gnu/libapr-1.la 
server/.libs/libmain.a(util_pcre.o): In function `ap_regfree':
util_pcre.c:(.text+0x109): undefined reference to `pcre_free'
server/.libs/libmain.a(util_pcre.o): In function `ap_regcomp':
util_pcre.c:(.text+0x196): undefined reference to `pcre_compile2'
util_pcre.c:(.text+0x1f4): undefined reference to `pcre_fullinfo'
server/.libs/libmain.a(util_pcre.o): In function `ap_regexec_len':
util_pcre.c:(.text+0x3b5): undefined reference to `pcre_exec'
server/.libs/libmain.a(util_pcre.o): In function `ap_regname':
util_pcre.c:(.text+0x5c3): undefined reference to `pcre_fullinfo'
util_pcre.c:(.text+0x5e3): undefined reference to `pcre_fullinfo'
util_pcre.c:(.text+0x603): undefined reference to `pcre_fullinfo'
collect2: error: ld returned 1 exit status
/home/jack/Documents/apache/httpd-2.4.23/build/program.mk:22: recipe for target 'httpd' failed
make[1]: *** [httpd] Error 1
make[1]: Leaving directory '/home/jack/Documents/apache/httpd-2.4.23'
/home/jack/Documents/apache/httpd-2.4.23/build/rules.mk:75: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
EN

回答 1

Stack Overflow用户

发布于 2018-07-13 07:37:42

我通过使用带有configure--with-pcre并指向已安装的PCRE的正确路径解决了这个问题。

例如:./configure --prefix=/u01/app/apache/apr/ --with-pcre=/u01/app/apache/pcre/bin

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39063292

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档