I would like install the Alternative PHP Cache (APC) on my mac.
With PECL this is supposedly a rather painless operation.
All one needs to do is:
sudo pecl install apc
As others have reported on the interwebs, apc
depends on pcre
, the PHP compatible regular expression library.
Now I've installed the latest version of PHP and PEAR/PECL using fink. I've also installed pcre
using fink:
i pcre 8.21-2 Perl Compatible Regular Expressions Library
The problem is, when trying to use sudo pecl install apc
, pecl
is checking the default directories for the pcre
libraries and not looking in /sw
:
cc -D_GNU_SOURCE -I. -I/private/tmp/pear/temp/APC -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootPtlYda/APC-3.1.13/include -I/private/tmp/pear/temp/pear-build-rootPtlYda/APC-3.1.13/main -I/private/tmp/pear/temp/APC -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/APC/apc.c -fno-common -DPIC -o .libs/apc.o
In file included from /private/tmp/pear/temp/APC/apc.c:45:
/usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found
#include "pcre.h"
^
1 error generated.
make: *** [apc.lo] Error 1
ERROR: `make' failed
Hence I have two questions:
- Is there an environment variable I can set to point to the fink
pcre
libraries for compilingapc
? - Where exactly is fink even putting
pcre
?
UPDATE
I see this question regarding Macports:
sudo pecl install apc error on os x lion
In this question, the answer involves symlinking the needed pcre
headers to their expected location for PECL.
I tried a similar solution. For the fink approach, the symlink command here is:
sudo ln -s /sw/include/pcre.h /usr/include/
But still this did not work. The installation of APC via PECL does not seem to be able to find this header file.
And I should add, indeed, the pcre.h
header file is found in /sw/include/pcre.h
.