微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

OSX Big Sur 无法安装 php 7.4 intl

如何解决OSX Big Sur 无法安装 php 7.4 intl

自从我的带有 PHP@7.4 的新 MacBook OS X Big Sur 给 XAMPP 带来问题以来,我越来越疯狂了。

据我所知,使用 OS X 中的 PHP 比使用 XAMPP 更好,但是在尝试使用 brew 安装 intl 时出现错误。这是我的代码

sudo pecl install intl

当我运行上述程序时,我收到此警告:

PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried:    /usr/local/lib/PHP/pecl/20190902/intl (dlopen(/usr/local/lib/PHP/pecl/20190902/intl,9): image not found),/usr/local/lib/PHP/pecl/20190902/intl.so (dlopen(/usr/local/lib/PHP/pecl/20190902/intl.so,9): image not found)) in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/PHP/pecl/20190902/intl (dlopen(/usr/local/lib/PHP/pecl/20190902/intl,9): image not found)) in UnkNown on line 0
downloading intl-3.0.0.tgz ..

然后我被问到 ICU 的路径。

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

我按 ENTER 得到这个:

running: /private/tmp/pear/temp/intl/configure --with-PHP-config=/usr/local/opt/PHP@7.4/bin/PHP-config --with-icu-dir=DEFAULT

然后安装开始,但最后我得到这个错误

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@7.4/bin/PHP-config --with-icu-dir=DEFAULT' Failed

如果我做:

which PHP

我明白了:

/usr/local/opt/PHP@7.4/bin/PHP

谁能给出真正的解决方案?

谢谢!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。