Apache ./configure can't find pcre-config script

9

2

I'm trying to install Apache on Red Hat. It's a system I don't have full control over (my sysadmins have given me a directory to work in). So I've downloaded, configured, and installed APR, APR-Util, and PCRE, in addition to Apache 2.4.7.

I ran the following for APR:

./configure --prefix=/u01/app/apache/apr/
make
make install

Received the warning to remember to run

libtool --finish /usr/local/apr/lib

I changed that to

libtool --finish /u01/app/apache/apr/lib/

and it said it installed the Libraries in that location

Similarly, for APR-Util, ran:

./configure --prefix=/u01/app/apache/apr-util/ --with-apr=/u01/app/apache/apr/bin
make
make install

Told me the Libraries were installed in /u01/app/apache/apr-util//lib

Next, PCRE:

./configure --prefix=/u01/app/apache/pcre/ --with-apr=/u01/app/apache/apr/bin --with-apr-util=/u01/app/apache/apr-util/bin
make
make install

So far, no problems. Now I try to configure apache

./configure --prefix=/u01/app/apache/apache247/ --with-apr=/u01/app/apache/apr/bin --with-apr-util=/u01/app/apache/apr-util/bin --with-pcre=/u01/app/apache/pcre/bin

It finds APR and APR-Util, but of course, I get the error "Did not find pcre-config script at /u01/app/apache/pcre/bin". Why, I don't know, as the file is there at that location. What am I doing wrong? Thanks!

Shawn

Posted 2013-11-25T20:56:46.903

Reputation: 320

Answers

13

I solved it by specifying the full path to the pcre-config file. In other words, instead of:

--with-pcre=/u01/app/apache/pcre/bin

I did:

--with-pcre=/u01/app/apache/pcre/bin/pcre-config

Shawn

Posted 2013-11-25T20:56:46.903

Reputation: 320

You made my day! – Mohamed Ennahdi El Idrissi – 2015-03-04T11:28:52.697

0

Installed pcre-8.37 from pcre.org .os is rhel 7.3 and httpd 2.4.23.After installing pcre there was no need to show the path explicitly

praveen

Posted 2013-11-25T20:56:46.903

Reputation: 1

httpd 2.4.25 still needs to specify the path to the pcre-config script, not the directory. e.g. it's --with-pcre=/home/ubuntu/pcre-8.39/pcre-config – Max – 2017-05-12T07:13:00.663

0

This is a shell script and thus it must begin with #!/path/to/interpreter . The most probable cause of your problem is, that this path is bad. For example it is #!/bin/perl although your perl is in /usr/bin. Check this, if it is not ok, fix it manually and retry.

peterh - Reinstate Monica

Posted 2013-11-25T20:56:46.903

Reputation: 2 043

Uggh, since I'm not a PERL programmer, I'll ask your indulgence. I found perl in usr/bin, not /bin. How do I "fix it manually". – Shawn – 2013-11-25T21:28:15.343

for example, I tried ./configure --prefix=/u01/app/apache/apache247/ --with-apr=/u01/app/apache/apr/bin --with-apr-util=/u01/app/apache/apr-util/bin --with-pcre=#!/usr/bin/ /u01/app/apache/pcre/bin and get -bash: !/usr/bin/: event not found – Shawn – 2013-11-25T21:41:05.277

It was only an example. It isb't probably a perl script. Is this path ok or not? From your error message I see that it is really bad. This seems to be a really dirty error message, with some exotic redhat flavour. – peterh - Reinstate Monica – 2013-11-25T21:49:47.950

the path to the pcre-config script is good. I see that file on the file system. All of the paths I'm using are good, as far as I can tell, as I see all the files on the file system. – Shawn – 2013-11-25T21:53:17.600

Nooo! I see. This --with-pcre option shouldn't begin with #! !!! That is the pcre-config script in your pcre/bin ! Please vote up my help, ask on stackoverflow what is an interpreter and what is this #! on the beginning of some script files, vote up their useful answers too, and come back. – peterh - Reinstate Monica – 2013-11-25T21:53:40.580

I guess I don't see. I started the --with-pcre option without the #! initially. I only tried it the wrong way as I was trying to figure out what to do with the #!. My original question shows how I tried it initially, and that was without the #!. Where do I use the #!? I'll gladly upvote, but I'm no closer to understanding than I was in the first place. – Shawn – 2013-11-25T22:03:25.863

This is what you should ask on stackoverflow. The answer is simple. I gladly help but I want to see your wish to learn. – peterh - Reinstate Monica – 2013-11-25T22:09:25.443

I asked this question on SO, and got sent here. There are 30000 questions about #!. You seriously expect me to go through them all? I would expect the Apache docs to mention needing an interpreter, but they don't. Sorry, but you've been much less than helpful. – Shawn – 2013-11-25T22:15:59.250

-1

Make sure you are not using pcre2. download and compile pcre, try re-run.

eight Stacker

Posted 2013-11-25T20:56:46.903

Reputation: 9