Open ozahorulia opened 1 year ago
I've run into this as well. The problem seems to be that the php pcre header, which apcu depends on, has a dependency on the pcre2 headers, but they aren't being configured into the include path for the compiler. The configure output includes this on my machine:
checking for PHP includes... -I/opt/homebrew/Cellar/php@8.1/8.1.22/include/php -I/opt/homebrew/Cellar/php@8.1/8.1.22/include/php/main -I/opt/homebrew/Cellar/php@8.1/8.1.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.1/8.1.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.1/8.1.22/include/php/ext -I/opt/homebrew/Cellar/php@8.1/8.1.22/include/php/ext/date/lib
but there are files in those paths that depend on things outside of those paths. Nominally, either the php-config needs to include the headers for pcre2 in it's compiler includes, or the apcu configure process needs to go looking for them as a secondary dependency. I've confirmed this by adding -I/opt/homebrew/Cellar/pcre2/10.42/include
to the list of includes in my php-config script and then successfully installing apcu with sudo pear install apcu
.
I've run into this as well and I've solved this problem and hope it can be helpful to you.
First
ls -l /opt/homebrew/Cellar/pcre2
If you don't have this directory, please execute:
brew install pcre2
Then
cd /opt/homebrew/Cellar/php@8.1/8.1.28/include/php/ext/pcre
And
ln -s /opt/homebrew/Cellar/pcre2/10.43/include/* ./
Last execute:
sudo pecl install apcu
or sudo pear install apcu
Neither pecl nor compiling from source code works for me. Here is the full output from pecl (same with the source code during the make stage):
PHP version is 8.1.23