PHP Intl 类在I18n的网站中真的很方便,允许你依赖在终端用户区域,很容易的输出正确的日期格式。
在使用 yii2-app-ecom(https://github.com/opus-online/yii2-app-ecom), 初始化之后,访问首页出现了:
The default currency code for the formatter is not defined.
看了issue The default currency code for the formatter is not defined #7(https://github.com/opus-online/yii2-app-ecom/issues/7) ,说要安装php_intl 扩展。
安装可以通过:
sudo apt-get install php_intl
安装完之后,记得重启Apache:
sudo service apache2 restart
你可以检查那些扩展是运行:
php -m
当然也可以使用php 代码的形式检查intl是否允许:
var_dump(extension_loaded('intl'));