sudo pecl install apc error on os x lion

元气小坏坏 提交于 2019-12-10 01:14:03

问题


I tried installing APC with pecl on OS X Lion (sudo pecl install apc) and it complained about a missing pcre.h file:

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"

So I used MacPorts to install the pcre package (sudo port install pcre) but it still complains. How can I fix this?


回答1:


I think this is because MacPorts installs the header files in a different location from where pecl expects them.

To fix this error, I symlinked pcre.h to /usr/include:

sudo ln -s /opt/local/include/pcre.h /usr/include/

When running sudo pecl install apc it compiled just fine.




回答2:


"brew install pcre" worked for me.



来源:https://stackoverflow.com/questions/10767983/sudo-pecl-install-apc-error-on-os-x-lion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!