sudo pecl install apc error on os x lion
Asked Answered
M

2

13

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?

Madeira answered 26/5, 2012 at 16:27 Comment(0)
M
27

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.

Madeira answered 26/5, 2012 at 16:27 Comment(3)
This still works for Mavericks. I had the same problem, Googled it, and found my own answer :DMadeira
Works on Mountain Lion (10.8.5) too.Boger
This worked for me when installing "sudo pecl install imagick" on mac Yosemite 10.10.5Tilth
S
15

"brew install pcre" worked for me.

Seligmann answered 14/8, 2013 at 16:36 Comment(1)
This solution worked for me on OS X, thanks. Hard to say which of above is easier.Petrinapetrine

© 2022 - 2024 — McMap. All rights reserved.