简体   繁体   English

如何使用 PHP 7.4 安装 APCu

[英]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.我在装有 Apple M1 Max 芯片的 MacBook 上将 php 7.4 安装到 OSX 12.1 上。

I followed this instruction: https://getgrav.org/blog/macos-monterey-apache-mysql-vhost-apc我按照以下说明操作: https://getgrav.org/blog/macos-monterey-apache-mysql-vhost-apc

Now I try to install APCu.现在我尝试安装 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.在 /private/tmp/pear/temp/apcu/php_apc.c:34 中包含的文件中:在 /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: 致命错误: 'pcre2.h' 文件未找到#include "pcre2.h" ^~~~~~~~~产生 1 个错误。 make: *** [php_apc.lo] Error 1 ERROR: `make' failed制作:*** [php_apc.lo] 错误 1 错误:`make' 失败

How can I fix that problem?我该如何解决这个问题?

Thanks for help.感谢帮助。

I find the problem.我发现了问题。 Brew installed pcre2 to another directory. Brew 将 pcre2 安装到另一个目录。 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/ cp /opt/homebrew/Cellar/pcre2/10.39/include/pcre2.h /opt/homebrew/Cellar/php@7.4/7.4.27/include/php/ext/pcre/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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