gpt4 book ai didi

php - 尝试安装 intl 扩展 macOS Catalina 和 PHP 7.4.10

转载 作者:行者123 更新时间:2023-12-03 08:36:14 26 4
gpt4 key购买 nike

我正在尝试安装 PHP 7.4.10zipintl 扩展

我运行

sudo pecl install intl

然后请求安装:

Specify where ICU libraries and headers can be found [DEFAULT] : 

然后我按 Enter 并继续,但随后显示下一个错误:

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

控制台显示:

If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> /Users/user/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> /Users/user/.bash_profile

For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"

For pkg-config to find icu4c you may need to set:
export .bash_profile="/usr/local/opt/icu4c/lib/pkgconfig"

我将所有路径添加到 .bash_profile 配置文件并运行:

source .bash_profile

此时我不确定我仍然收到什么待办事项:

== 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 restart

我还检查了很多通过 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与brew一起安装时,它不会将其文件复制到pkg-config配置目录。因此,另一个解决方法是将 PKG_CONFIG_PATH 设置为 lib 所在的文件夹。示例:

PKG_CONFIG_PATH=/usr/local/Cellar/icu4c/69.1/lib/pkgconfig/ pkg-config --cflags --libs libsoup-2.4

关于php - 尝试安装 intl 扩展 macOS Catalina 和 PHP 7.4.10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63816517/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com