Problems with Lib-Icu Dependency When Installing Symfony 2.3.X via Composer

Problems with lib-icu dependency when installing Symfony 2.3.x via Composer

update your php-intl extension, that's where the icu error comes from!

sudo aptitude install php5-intl                 // i.e. ubuntu
brew install icu4c // osx

check the extension is enabled and properly configured in php.ini aswell.

( hint: php-cli sometimes uses a different php.ini )

php.ini

extension=intl.so       ; *nix
extension=php_intl.dll ; windows

[intl]
intl.default_locale = en_utf8
intl.error_level = E_WARNING

check your phpinfo() AND php -m from your terminal if the extension has been succesfully enabled.

Check your current intl versions from php with:

Intl::getIcuVersion();
Intl::getIcuDataVersion();

attention: not needed anymore ( symfony 2.3 has meanwhile been released )

add the minimum stability flag @dev or @rc to your dependency like this please:

composer create-project symfony/framework-standard-edition mynewerproject/ 2.3.*@dev 

The default stability in composer is stable which symfony 2.3 branch is not currently ( it's @rc ). Read more an stability flags here.

Problems installing Symfony 2.4.1 lib-icu 4.4 dependency

For your specific situation, you should specify in your composer.json file that you want to use "symfony/icu": "1.1.*"

See the "ICU and Deployment Problems" section of this page: https://symfony.com/doc/2.4/components/intl.html

Symfony2 and composer not installing packages

The issue is still present because you are running composer update only for FOSUserBundle.

First try to run composer update symfony/icu, and then run composer update friendsofsymfony/user-bundle.

If this doesn't work, try updating all your vendors with composer update

Problems with installing Symfony 2?

Based on discussion in the comments, this error appears to be because you're using PHP 5.2. Composer required at least 5.3.2 to run.

Aside from that, this question appears to be a duplicate of PHP: Class 'Phar' not found

How to download bundles via composer without having an icu version error in Windows environment?

The thing is that the php.ini used by Apache is not the same as the one use in command line.

To know what php.ini the command line uses, type :

php --ini

and the php extension have to be set on in the php.ini mentionned. To be sure it is fine, we can type :

php -m

wampserver does not change this php.ini (normally the php folder one) but Apache one (in the Apache folder).

intl and icu configuration

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.



Related Topics



Leave a reply



Submit