正在尝试安装int扩展macOS Catalina和PHP7.4.10

正在尝试安装int扩展macOS Catalina和PHP7.4.10,php,zip,config,intl,Php,Zip,Config,Intl,我正在尝试为PHP7.4.10安装zip和intl扩展 我跑 然后安装程序请求: 指定可以找到ICU库和头的位置[默认]: 然后我点击回车键并继续,但随后显示下一个错误: configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met: No package 'icu-uc' found No package 'icu-io' found No package 'icu-i18n'

我正在尝试为
PHP7.4.10
安装
zip
intl
扩展

我跑

然后安装程序请求:

指定可以找到ICU库和头的位置[默认]:
然后我点击回车键并继续,但随后显示下一个错误:

configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:

No package 'icu-uc' found
No package 'icu-io' found
No package 'icu-i18n' found
然后我开始研究如何安装
icu
,我运行:

brew install icu4c
控制台显示:

如果需要在路径中首先运行icu4c:
echo'export PATH=“/usr/local/opt/icu4c/bin:$PATH”>>/Users/user/.bash\u profile
echo'export PATH=“/usr/local/opt/icu4c/sbin:$PATH”>>/Users/user/.bash\u profile
要让编译器找到icu4c,您可能需要设置:
export LDFLAGS=“-L/usr/local/opt/icu4c/lib”
export CPPFLAGS=“-I/usr/local/opt/icu4c/include”
要使pkg config找到icu4c,您可能需要设置:
export.bash_profile=“/usr/local/opt/icu4c/lib/pkgconfig”
我将所有路径添加到
.bash\u配置文件中,然后运行:

source.bash\u配置文件
此时,我不确定我仍在接受什么:

== Environment ==
!! php_extension zip !!
[System] must be installed and enabled - The Zip PHP extension is now required by Moodle, info-ZIP binaries or
PclZip library are not used anymore.


!! php_extension intl !!
[System] must be installed and enabled - Intl extension is required to improve internationalization support, such as
locale aware sorting and international domain names.
即使在运行
sudo apachectl重启后

此外,我还查阅了大量指南,通过
php.ini
添加
extension=zip
安装
zip
扩展,但它不起作用

任何帮助都将不胜感激

[更新]我试图使用帖子的第一个答案,我在运行完所有命令后得到了答案,最后一个命令输出是
sudo pecl UPDATE channels&&sudo pecl install intl

checking for icu-uc >= 50.1 icu-io icu-i18n... no
configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:

No package 'icu-uc' found
No package 'icu-io' found
No package 'icu-i18n' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ICU_CFLAGS
and ICU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
ERROR: `/private/tmp/pear/temp/intl/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-icu-dir=/usr/local/opt/icu4c' failed

您的系统上是否存在icu4c?以下内容的输出是什么:

which icu4c
如果您没有输出,我们可以进一步调查。快速浏览一下,我们会发现这个库依赖于autoconf

brew update

brew install autoconf automake libtool

brew install icu4c
现在,让我们检查icu4c是否安装正确

which icu4c
如果此时您仍然没有输出,那么最好从源代码安装并编译icu4c。因为通过自制安装的库可能会受到影响

之后你可以继续

sudo pecl update-channels && sudo pecl install intl
如果有人问你

指定可以找到ICU库和头的位置[默认]:

答案是

/usr/local/opt/icu4c

您的系统上是否存在icu4c?以下内容的输出是什么:

which icu4c
如果您没有输出,我们可以进一步调查。快速浏览一下,我们会发现这个库依赖于autoconf

brew update

brew install autoconf automake libtool

brew install icu4c
现在,让我们检查icu4c是否安装正确

which icu4c
如果此时您仍然没有输出,那么最好从源代码安装并编译icu4c。因为通过自制安装的库可能会受到影响

之后你可以继续

sudo pecl update-channels && sudo pecl install intl
如果有人问你

指定可以找到ICU库和头的位置[默认]:

答案是

/usr/local/opt/icu4c

尝试下面链接中的方法:对我来说不是working@Thierrydev我试过了,但没有成功尝试下面链接中的方法:对我来说不是working@Thierrydev我试过了,但没有成功