如何使用PHP 7.4安装APCu



我在带有Apple M1 Max芯片的MacBook上安装了OSX 12.1上的php 7.4。

我遵循了以下指示:https://getgrav.org/blog/macos-monterey-apache-mysql-vhost-apc

现在我尝试安装APCu。但我收到了这个错误消息:

在/private/tmp/pear/temp/apcu/php_apc.c:34中包含的文件中:在/private/tmp/pear/temp/apcu/apc_iterator.h:26中包含的文件中:/选择/自制/大提琴/php@7.4/7.4.27/include/php/ext/pcre/php_pcre.h:25:10:致命错误:找不到"pcre2.h"文件#包括";pcre2.h";^~~~~~~~~生成1个错误。make:***[php_apc.lo]错误1错误:"make"失败

我该如何解决这个问题?

谢谢你的帮助。

我发现了问题。Brew将pcre2安装到另一个目录。我用这个命令复制了文件,然后它就工作了:

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

最新更新