0

On a new EC2, I am facing one type of problem while compiling httpd. It seems like code of Apache cannot find functions / function definitions from libraries.

Steps I took on a fresh RHEL to install httpd.

    sudo yum install gcc
    extracted apr's and apr's source in respective directories under srclib of httpd source code
    compiled latest pcre
    sudo yum install pcre-devel (because of error cannot find pcre.h while ./configure)
    ./configure --with-included-apr --prefix='/server/httpd/httpd-2.4.17' --with-pcre='/usr/local/bin/pcre-config' --with-ssl='/usr/bin/openssl'
    make

during the make install step everything goes fine for a while and then following array of error pops up. I think all the errors are linked.

    /server/httpd/httpd-2.4.17-source/server/util_pcre.c:104: undefined reference to `pcre_free'
    server/.libs/libmain.a(util_pcre.o): In function `ap_regcomp':
    /server/httpd/httpd-2.4.17-source/server/util_pcre.c:138: undefined reference to `pcre_compile2'
    /server/httpd/httpd-2.4.17-source/server/util_pcre.c:151: undefined reference to `pcre_fullinfo'
    server/.libs/libmain.a(util_pcre.o): In function `ap_regexec_len':
    /server/httpd/httpd-2.4.17-source/server/util_pcre.c:207: undefined reference to `pcre_exec'
    server/.libs/libmain.a(util_pcre.o): In function `ap_regname':
    /server/httpd/httpd-2.4.17-source/server/util_pcre.c:269: undefined reference to `pcre_fullinfo'
    /server/httpd/httpd-2.4.17-source/server/util_pcre.c:271: undefined reference to `pcre_fullinfo'
    /server/httpd/httpd-2.4.17-source/server/util_pcre.c:273: undefined reference to `pcre_fullinfo'

After some googling I found if I could correct the way gcc is being called in Makefile, it could fix the issue but I even can't find the term "gcc" in Makefile.

Please help.

UPDATE

I can easily reproduce this on my local Ubuntu machine too with the same steps. for ubuntu install libpcre3-dev instead of pcre-devel

1 Answer 1

2

After wasting more than 20 hours in this issue I have got a solution.

Latest pcre version is pcre2-10.10 When I reinstalled (compiled from source) pcre with an older version pcre-8.38, the compilation worked without any error.

    make clean (because wrong tries with ./configure messes up the Makefile)
    ./configure <options>
    make 
    make install
1
  • Thanks to Krishna, Just do not use pcre2 package when you compile Apache httpd. Early version works perfectly. Jan 28, 2020 at 21:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .