Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx install on Mac OS X Lion. Cannot find PCRE

First up, I am trying to compile everything form source, I'm not using MacPorts or HomeBrew.

I have already installed pcre to /usr/local/pcre-8.21 and symlinked this to /usr/local/pcre.

I have set /usr/local/pcre/bin to my PATH variable here.

`/usr/local:/usr/local/mysql/bin:/usr/local/pcre/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin`

I am now trying to install Nginx, but I keep getting this message:

./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.

I tried setting --with-pcre=/usr/local/pcre/bin but it just tries to re-install PCRE.

Can anyone help me get round this? Thanks.

like image 895
steveYeah Avatar asked Jan 22 '12 17:01

steveYeah


2 Answers

Nginx requires PCRE – Perl Compatible Regular Expressions(http://www.pcre.org/)

download PCRE and install PCRE:

cd pcre-8.01
./configure --prefix=/usr/local
make
sudo make install

in nginx folder type in to install:

cd nginx-0.8.33
./configure --prefix=/usr/local --with-http_ssl_module
make
sudo make install
like image 198
LiJung Avatar answered Sep 20 '22 01:09

LiJung


The answer may already be found, but I still want to add my answer. When you use ./configure you should use --with-pcre=/path/to/pcre/source. So let's say the source code was saved in /usr/local/src/pcre then the command will look like this:

./configure --with-pcre=/usr/local/src/pcre

Hope this helps someone!

like image 31
Xenonbart Avatar answered Sep 19 '22 01:09

Xenonbart