我需要的
我实施的代码:
use Symfony\Component\Intl\Intl;
\Locale::setDefault('en');
$currencies = Intl::getCurrencyBundle()->getCurrencyNames();
$currency = Intl::getCurrencyBundle()->getCurrencyName('INR');
$symbol = Intl::getCurrencyBundle()->getCurrencySymbol('INR');
$fractionDigits = Intl::getCurrencyBundle()->getFractionDigits('INR');
$roundingIncrement = Intl::getCurrencyBundle()->getRoundingIncrement('INR');
Run Code Online (Sandbox Code Playgroud)
错误:
未实现Symfony\Component\Intl\Locale\Locale :: setDefault().请安装"intl"扩展名以获得完整的本地化功能.
500内部服务器错误 - MethodNotImplementedException
OS配置:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
NAME="Ubuntu"
VERSION="13.04, Raring Ringtail"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.04"
VERSION_ID="13.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
Run Code Online (Sandbox Code Playgroud)
Azh*_*tak 13
Michael Sivolobov为 debian 9 /stretch 上的 php7扩展答案
sudo apt-get install php7.0-intl
Run Code Online (Sandbox Code Playgroud)
或者干脆
sudo apt-get install php-intl
Run Code Online (Sandbox Code Playgroud)
然后
sudo service apache2 restart
Run Code Online (Sandbox Code Playgroud)
谢谢!
如果您在Windows上使用XAMPP,则方法如下:
例如打开c:\ xampp \ php \ php.ini并删除分号“;” 在“ extension = php_intl.dll”前面保存文件并重新启动apache。
那将解决错误信息。
做完了