intl and icu configuration

蹲街弑〆低调 提交于 2019-12-04 05:19:50

问题


I've been working on a local development machine running Ubuntu 12 developing a Symfony2.3.5 application.

All works well, until I uploaded the code and came across this:

Could not load the resource bundle "/home/project/public_html/vendor/symfony/icu/Symfony/Component/Icu/Resources/data/region/en.res".

The server is currently running the following:

CENTOS 5.9 x86_64 standard WHM 11.38.2 (build 7)

In WHM I've installed intl via the EasyApache installer, yet I'm still getting this error.

This installed ICU 3.6. My development version is 4.8.1, so about 10 years newer.

Is the ICU version the problem here? It's the only thing I can see.

The application I've built is en-only. It does not need to be in any other language other than English (UK).

Does anyone have any ideas / fixes for this?

Thanks


回答1:


Symfony 2.3 requires the intl extension to be version >= 4.0 ( a version greater than 4.4 at best ) because of it's dependency to the symfony/intl component.

Composer will download different versions of symfony/intl and lock these in your composer.lock depending on your development ICU version.

This means if you develop on a system with ICU greater than 4.4 you won't be able to install on a server with ICU < 4.4.

Please read the documentation chapter ICU and Deployment Problems.

Update your intl extension as suggested in my answer here:

sudo aptitude install php5-intl 

... or add

"require: {
    "symfony/icu": "1.0.*"
}

to your composer.json.




回答2:


For me worked installing symfony/intl

"symfony/intl": "2.5.5",

php composer.phar update symfony/intl


来源:https://stackoverflow.com/questions/19098455/intl-and-icu-configuration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!