简体   繁体   中英

How to install APCu with PHP 7.4

I installed php 7.4 onto OSX 12.1 onto a MacBook with Apple M1 Max Chip.

I followed this instruction: https://getgrav.org/blog/macos-monterey-apache-mysql-vhost-apc

Now I try to install APCu. But I get this error message:

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/php@7.4/7.4.27/include/php/ext/pcre/php_pcre.h:25:10: fatal error: 'pcre2.h' file not found #include "pcre2.h" ^~~~~~~~~ 1 error generated. make: *** [php_apc.lo] Error 1 ERROR: `make' failed

How can I fix that problem?

Thanks for help.

I find the problem. Brew installed pcre2 to another directory. I copied the file with this command, and then it worked:

cp /opt/homebrew/Cellar/pcre2/10.39/include/pcre2.h /opt/homebrew/Cellar/php@7.4/7.4.27/include/php/ext/pcre/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM