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.
Many applications will only be supporting "en" locale and will have no need for translation capabilities or php-intl. If this is you, or you can't install php-intl on your server, you can explicitly add symfony/icu ~1.0 to your composer.json
. 1.0 does not require php-intl, whereas 1.1+ does.
If you don't need translation features:
$ php bin/composer.phar require symfony/icu ~1.0
Without this declaration and trying to install symfony/symfony 2.3 Composer may try to install symfony/icu ~1.2 which would require you to install php-intl.
This is explicitly covered more extensively in the Symfony Intl Component's docs under "ICU and Deployment Problems".
A solution regarding this or similar problems can be found here: ICU and Deployment Problems
The behavior of composer should be intelligent selecting the right icu-component:
- symfony/icu 1.0.*: when the intl extension is not available
- symfony/icu 1.1.*: when intl is compiled with ICU 4.0 or higher
- symfony/icu 1.2.*: when intl is compiled with ICU 4.4 or higher
There should be (theoretically) no error installing symfony 2.3. with no intl-extension.
But you can be trapped when your development-environment differs from your production-server like mentioned in this article:
- the development machines are compiled with ICU 4.4 or higher, but the server is compiled >with a lower ICU version than 4.4
- the intl extension is available on the development machines but not on the server.
When you have no root-access to your production-server you can fix it as mentioned in this article. (tweaking composer.json)
Hope this additional information helped as it helped me for this special case with different environments.
Mac OS Mavericks comes with PHP 5.4.17 without intl. To get this, you'll have to follow those steps :
brew install icu4c
sudo pecl install intl
The path to the ICU libraries and headers is: /usr/local/opt/icu4c/
Edit /etc/php.ini and add extension=intl.so to the end.