安装国际PHP扩展OSX High Sierra [英] Install intl PHP extension OSX High Sierra

查看:62
本文介绍了安装国际PHP扩展OSX High Sierra的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在osx high sierra随附的PHP 7.1.7中安装intl PHP扩展?

How can I install intl PHP extension in PHP 7.1.7, which is delivered with osx high sierra?

推荐答案

所以我遇到了完全相同的问题.正如在此评论的其他人所指出的那样,High Sierra附带安装了PHP 7.1,并且此PHP版本已对其进行了国际编译.

So I had the exact same issue. As noted by other folks commenting here, High Sierra comes with PHP 7.1 installed and this PHP version has intl compiled with it

就我而言,我在下面的 Valet +中遵循了Neodork评论的一部分问题:

In my case, I followed part of Neodork comment's in the following Valet+ issue:

安装" PHP 7.1(因此它来自brew本身,而不是High Sierra安装的那个)

"Install" PHP 7.1 (so it comes from brew itself, not the one installed by High Sierra)

brew install php@7.1

将其升级到最新版本

brew upgrade php@7.1

在酒窖中供参考的符号链接:

Symlinks for references in Cellar:

brew link --overwrite --force php@7.1

在我的bash个人资料中更改PHP路径

Change PHP path in my bash profile

echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.bash_profile

重新加载您的bash个人资料(您可以关闭终端,然后再次打开它)

Reload your bash profile (you can close the terminal and open it again)

. ~/.bash_profile

检查国际航班

php -m | grep intl

注意:如果您遇到以下警告:

Note: If you come across with warnings like:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so'

然后您必须禁用上一个intl:

Then you have to disable the previous intl:

mv /usr/local/etc/php/7.1/conf.d/ext-intl.ini /usr/local/etc/php/7.1/conf.d/ext-intl.ini.disabled

希望有帮助!

这篇关于安装国际PHP扩展OSX High Sierra的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆