首页 > 解决方案 > 如何在 MAC M1 中为 php 版本 8.x 启用 intl 扩展?

问题描述

我的 PHP 版本是PHP 8.0.3. 我正在尝试为应用程序启用 php intl 扩展。

php -v

PHP 8.0.3 (cli) (built: Mar 11 2021 09:04:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies 

发出命令后我什么也没得到

php --modules | grep intl

我还通过以下命令使用 brew 升级了 php 版本

brew upgrade php         
Warning: php 8.0.7 already installed

尝试运行 cakephp 应用程序时出现以下错误

cake_4 % bin/cake bake                       
PHP Fatal error:  You must enable the intl extension to use CakePHP. in /Applications/XAMPP/xamppfiles/htdocs/cake_4/config/requirements.php on line 31

如何在 brew 中安装和加载 intl 扩展?

标签: phpmacos

解决方案


推荐阅读