在Mac OSX Mavericks使用自制软件php55每当我运行一个PHP命令时,我得到以下错误消息(一切运行正常它只是烦人)
PHP Warning: Module 'intl' already loaded in Unknown on line 0
Run Code Online (Sandbox Code Playgroud)
我跑了
php --ini
Run Code Online (Sandbox Code Playgroud)
而输出是
php --ini
PHP Warning: Module 'intl' already loaded in Unknown on line 0
Warning: Module 'intl' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File: /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed: /usr/local/etc/php/5.5/conf.d/ext-apcu.ini,
/usr/local/etc/php/5.5/conf.d/ext-igbinary.ini,
/usr/local/etc/php/5.5/conf.d/ext-intl.ini,
/usr/local/etc/php/5.5/conf.d/ext-memcached.ini,
/usr/local/etc/php/5.5/conf.d/ext-mongo.ini,
/usr/local/etc/php/5.5/conf.d/ext-uuid.ini,
/usr/local/etc/php/5.5/conf.d/ext-xdebug.ini
Run Code Online (Sandbox Code Playgroud)
在php.ini文件中检查并且加载了intl的唯一位置在顶部并且它被注释掉了.其他文件内容如下所示:
extension="/usr/local/Cellar/php55/5.5.23/lib/php/extensions/no-debug-non-zts-20121212/intl.so"
Run Code Online (Sandbox Code Playgroud)
最后一个斜杠后面的内容是扩展名.
我不知道还能在哪里看.
任何帮助表示赞赏
在国际扩展是枝条的延伸,增加了的localizeddate,localizednumber和localizedcurrency过滤器.如何安装和设置扩展程序,以便在Twig模板中使用这些过滤器?
如何在PHP 7.1.7中安装intl PHP扩展,这是与osx high sierra一起提供的?
我有一个debian服务器,我想通过pecl安装"intl"扩展.
在安装过程中,它询问我:"指定可以找到ICU库和标题的位置[DEFAULT]:"这里我一直在尝试几个选项,包括将其留空以使用DEFAULT,但是我收到以下错误:
configure:错误:C++预处理器"/ lib/cpp"无法进行健全性检查请参阅config.log' for more details.
ERROR:/ tmp/pear/temp/intl/configure --with-icu-dir = DEFAULT'失败
我已经安装了php5.3:make && make install.我已经安装了"icu",但与php5.3不同,它是用apt-get安装的(我不知道这是否重要).
任何的想法?
我最近更新了我的Android Studio和许多组件/ sdk,从那以后React-Intl抱怨intl库丢失,即使它之前工作正常.
我已经安装了intlpolyfill,我将它导入到我的主文件的最顶层App.js.我也导入localeData从react-intl和添加.然后,我在IntlProvider指定locale没有消息的情况下渲染我的视图(我FormattedNumber现在只使用)
这是我的代码的简化版本:
import 'intl';
import { IntlProvider, FormattedNumber, addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
addLocaleData(en);
[...]
render() {
return (
<IntlProvider locale="en">
<Text>
<FormattedNumber value={123} />
</Text>
</IntlProvider>
)
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
[React Intl]错误格式化编号.ReferenceError:尚未为此对象提供语言环境数据.
我不明白发生了什么.有人遇到同样的问题吗?
谢谢
我想在使用带货币的NumberFormatter PHP类(来自Intl扩展名)时设置精度为0 .但是我得到了一些奇怪的结果.这里:
$numberFormatter = new NumberFormatter('en-US', NumberFormatter::CURRENCY);
$numberFormatter->setAttribute(NumberFormatter::FRACTION_DIGITS, 0);
echo $numberFormatter->formatCurrency('45', 'USD');
Run Code Online (Sandbox Code Playgroud)
它输出$45,这是我想要的.但是,如果我EUR使用相同的设置更改货币:
echo $numberFormatter->formatCurrency('45', 'EUR');
Run Code Online (Sandbox Code Playgroud)
它输出€45.00(虽然我明确地设置为零精度).
更奇怪的是,如果我将语言环境设置为fr-FR,它会按预期输出数字:
$numberFormatter = new NumberFormatter('fr-FR', NumberFormatter::CURRENCY);
$numberFormatter->setAttribute(NumberFormatter::FRACTION_DIGITS, 0);
echo $numberFormatter->formatCurrency('45', 'EUR');
Run Code Online (Sandbox Code Playgroud)
它输出45 €.
这是一个错误吗?
我正在尝试使用PHP,2个字符的国家代码(ISO 3166-1)转换为国家/地区名称或国家/地区代码,因此我可以翻译国家/地区名称.
使用Locale::getDisplayRegion语言(nl_NL)的区域设置代码,我只需要2个字符的国家代码.我不想依赖Webservices,但我可以考虑geoip扩展(无论如何我找不到使用它的解决方案)
有没有办法获得2个字符国家代码并将其转换为PHP的本地化国家名称,而无需使用Web服务或外部资源?
(我前段时间使用的是zend_locale,但是zf2没有这个功能)
在使用 React Intl 进行本地化时,我们不断通过 Airbreak 从我们的 React 应用程序中获取随机错误消息。
错误信息
Invariant Violation: [React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.
Run Code Online (Sandbox Code Playgroud)
我们的应用程序非常小。我们有三页,其中一页嵌入了多个模态对话框,然后可能由用户打开。我们一直无法将这个问题定位到确切的浏览器、版本或代码点。
我们试图深入研究错误消息,并在没有运气的情况下找到确切原因。模态对话框作为主组件的子组件存在,并在呈现父组件时嵌入。
我们的 main.js 渲染是这样用 IntlProvider 包装的:
render() {
return (
<ErrorBoundary>
<IntlProvider locale={language} messages={messages[language]}>
<Router>
<Route render={({location}) => (
<div id="site-container">
...
Run Code Online (Sandbox Code Playgroud)
ErrorBoundary 是 Airbrake。IntlProvider 获取语言环境和翻译后的字符串。
父组件已注入 Intl:
Page.propTypes = {
intl: intlShape.isRequired
};
export default injectIntl(Page);
Run Code Online (Sandbox Code Playgroud)
IntlProvider 的用法与文档描述的一样,应该使用它,但是我们在这里遗漏了什么吗?这个错误的原因是什么?某些对话框没有获得为它提供的 intl?
我们不应该收到这些错误。如果确实如此,它似乎会导致任何页面加载完全崩溃。
我需要的
我实施的代码:
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)
intl ×10
php ×8
android ×1
country ×1
debian ×1
ini ×1
javascript ×1
locale ×1
pecl ×1
react-intl ×1
react-native ×1
reactjs ×1
symfony ×1
twig ×1
windows-xp ×1