我尝试在OS X Lion(sudo pecl install apc
)上安装带有pecl的APC,它抱怨缺少pcre.h文件:
In file included from /private/tmp/pear/temp/APC/apc.c:44:
/usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found
#include "pcre.h"
所以我使用MacPorts来安装pcre软件包(sudo port install pcre
),但它仍然抱怨。我该如何解决这个问题?
我认为
这是因为MacPorts将头文件安装在与pecl
期望的位置不同的位置。
为了修复此错误,我将pcre.h
符号链接到/usr/include
:
sudo ln -s /opt/local/include/pcre.h /usr/include/
运行时sudo pecl install apc
它编译得很好。
"
brew install pcre"对我有用。