2012-01-22 165 views
10

首先,我试图编译源代码的所有内容,我没有使用MacPorts或HomeBrew。Nginx安装在Mac OS X Lion上。找不到PCRE

我已经安装了pcre到/usr/local/pcre-8.21,并将其符号链接到/usr/local/pcre

我已经设置/usr/local/pcre/binPATH变量在这里。

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

我现在正在尝试安装Nginx的,但我不断收到这样的信息:

./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.

我试着设置--with-pcre=/usr/local/pcre/bin,但它只是试图重新安装PCRE。

谁能帮我避开这个问题? 谢谢。

+2

你试过--with-PCRE =在/ usr /本地/ PCRE(顺便说一句,这就是为什么人们使用的MacPorts /家酿避免的问题,这个追逐) – Mark

+0

如果我添加一个路径PCRE它会创建一个Makefile,但是当你运行make时它会尝试查找pcre makefile时引发错误。 (在Linux上我所有的软件包管理器,但在Mac上我发现他们混乱和不可靠,但是,他们让生活变得更容易) – steveYeah

+0

声音像pcre没有正确安装它的include和lib文件的位置? – Mark

回答

10

Nginx的需要PCRE - Perl兼容的正则表达式(http://www.pcre.org/

下载PCRE和安装PCRE:

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

在nginx的文件夹中键入安装:

cd nginx-0.8.33 
./configure --prefix=/usr/local --with-http_ssl_module 
make 
sudo make install 
2

答案可能已经被发现,但我仍然想要添加我的答案。 当你使用./configure时,你应该使用--with-pcre =/path/to/pcre/source。所以我们说的源代码保存在/ usr/local/src目录/ PCRE则命令将是这样的:

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

希望这可以帮助别人!

+0

是的,这是在问题中添加的。最后,我想我删除了PCRE的安装,并允许它在安装Nginx时重新安装它 – steveYeah

0

我面临同样的问题。这些命令解决我的问题:

打开MAC终端并运行此命令:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

然后运行:

brew install pcre

完成!

来源:http://macappstore.org/pcre-2/