I believe I found the answer.
Inspecting the file that is expecting pcre.h
(/usr/include/php/ext/pcre/php_pcre.h:29
) I see this:
#include "pcre.h"
Perhaps there is a way to add an include path during a PECL installation, but I am unaware of how to do so.
My solution then was to simply place the symlink to pcre.h
in the directory containing this offending source file. Like so:
sudo ln -s /sw/include/pcre.h /usr/include/php/ext/pcre/
That did it. Maybe folks have a more elegant way to do this but for others with this problem, this should get the job done.
VERY IMPORTANT UPDATE
Actually, I should note that my above information is incomplete and will not work.
The problem is, one must be certain to first install the fink package php5-dev.
Frankly, I think the fink package php-pear
should be made to have php5-dev
as a dependency. It does not, and I for the moment am not familiar in maintaining fink packages so this will have to do.
The consequences of not having this package is simply that the requisite header files needed when compiling APC
are not available for fink version of php. They are, fortunately or unfortunately, available for the Mountaion Lion included PHP. The consequences of this is that although APC will compile, it will be linked against the wrong version of PHP.
After one updates their php.ini
with the requisite extension=apc.so
, as instructed by the conclusion of the apc
installation, the following message will be found in their apache error file. (For Fink this is at /sw/var/log/apache2/error.log
):
PHP Startup: apc: Unable to initialize module\nModule compiled with module API=20090626\nPHP compiled with module API=20100525
The solution to this was to simply to sudo pecl uninstall apc
then do sudo fink install php5-dev
, then finally do sudo pecl install apc
.
The final install of apc
will use the include files added by php5-dev
and all will be well.
Then you can confidently add extension=apc.so
to /sw/etc/php5/apache2/php.ini
.
One more thing
Also note that my above instructions for for symlinking the pcre.h
file have to be modified slightly to be:
sudo ln -s /sw/include/pcre.h /sw/include/php5/ext/pcre
The fact that pecl
was messing with things in /usr
and not a /sw
directory should have tipped things off for me.