所以我有完全相同的问题。正如其他人在这里评论所指出的,High Sierra 附带安装了 PHP 7.1,并且该 PHP 版本已对其进行了 intl 编译
就我而言,我遵循了以下 Neodork 评论的部分内容代客泊车+问题 https://github.com/weprovide/valet-plus/issues/127#issuecomment-378914908:
“安装”PHP 7.1(因此它来自brew本身,而不是High Sierra安装的)
brew install [email protected] /cdn-cgi/l/email-protection
升级到最新版本
brew upgrade [email protected] /cdn-cgi/l/email-protection
Cellar 中参考的符号链接:
brew link --overwrite --force [email protected] /cdn-cgi/l/email-protection
更改我的 bash 配置文件中的 PHP 路径
echo 'export PATH="/usr/local/opt/[email protected] /cdn-cgi/l/email-protection/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/[email protected] /cdn-cgi/l/email-protection/sbin:$PATH"' >> ~/.bash_profile
重新加载您的 bash 配置文件(您可以关闭终端并再次打开)
. ~/.bash_profile
检查国际
php -m | grep intl
Note:如果您遇到类似警告:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-intl/intl.so'
然后你必须禁用之前的 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
希望能帮助到你!