You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to install apcu with pecl install apcu2.
Note that pecl and pear seem to come with the PHP installed with brew, that's why I'm opening the issue here, as I think that this issue is related to the PHP installation with brew - pcre2 should also be installed when installing PHP.
What happened (include all command output)?
I get this error
...
ivate/tmp/pear/temp/pear-build-nbros8mwyT/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.2.27/include/php -I/opt/homebrew/Cellar/[email protected]/8.2.27/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.2.27/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.2.27/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.2.27/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.2.27/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/php_apc.c -MMD -MF php_apc.dep -MT php_apc.lo -fno-common -DPIC -o .libs/php_apc.o
In file included from /private/tmp/pear/temp/apcu/php_apc.c:34:
In file included from /private/tmp/pear/temp/apcu/apc_iterator.h:26:
/opt/homebrew/Cellar/[email protected]/8.2.27/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 'pcre2.h' file not found
23 | #include "pcre2.h"
| ^~~~~~~~~
1 error generated.
make: *** [php_apc.lo] Error 1
ERROR: `make' failed
The PCRE extension is a core PHP extension, so it is always enabled. By default, this extension is compiled using the bundled PCRE library. Alternatively, an external PCRE library can be used by passing in the --with-pcre-regex=DIR configuration option where DIR is the location of PCRE's include and library files. It is recommended to use PCRE 8.10 or newer; as of PHP 7.3.0, PCRE2 is required.
If APCu uses PCRE2 and version 8 of PHP requires PCRE2, then, when you install PHP 8 with brew, PCRE2 should also be installed automatically and linked correctly.
1. `brew install [email protected]` (or php or [email protected]), thenexport the bin folder to the path, so that `php` points to this version
2. `pecl install apcu`
If I do brew list | grep pcre2, I actually get pcre2, so it's installed, but probably not linked correctly.
In fact, if I do brew uses pcre2 --installed, I also get that also PHPs depend on it
Does PECL get its dependency locations from PHP? Because I understood it always made an educated guess, just like other build systems. That's why you need to tell it where to find dependencies.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew config
brew doctor
Verification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I was trying to install
apcu
withpecl install apcu2
.What happened (include all command output)?
I get this error
Now,
APCu
is a replacement forAPC
. See https://www.php.net/manual/en/book.apcu.php.According to the PHP docs https://www.php.net/manual/en/pcre.installation.php
If I do
php -m
, I don't getpcre2
PCRE2: https://github.com/PCRE2Project/pcre2
What did you expect to happen?
If APCu uses PCRE2 and version 8 of PHP requires PCRE2, then, when you install PHP 8 with brew, PCRE2 should also be installed automatically and linked correctly.
Step-by-step reproduction instructions (by running
brew
commands)If I do
brew list | grep pcre2
, I actually getpcre2
, so it's installed, but probably not linked correctly.In fact, if I do
brew uses pcre2 --installed
, I also get that also PHPs depend on itOther
See also https://stackoverflow.com/q/72039019 e.g.
The text was updated successfully, but these errors were encountered: