Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A php platform install ask me intl extension, but it seems already installed

During orocrm installation (a platform developed with symfony 2) I receive this error

Fatal error: Uncaught exception 'Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException' with message 'The   Symfony\Component\Intl\Collator\Collator::__construct() method's argument $locale value 'fr_FR' behavior   is not implemented. Only the locale "en" is supported.  Please install the "intl" extension for full    localization capabilities.' in /Users/ale/Sites/educacloud-  bo/vendor/symfony/symfony/src/Symfony/Component/Intl/Collator/Collator.php:80
Stack trace:
#0 /Users/ale/Sites/educacloud-bo/app/SymfonyRequirements.php(619):   Symfony\Component\Intl\Collator\Collator->__construct('fr_FR')
#1 /Users/ale/Sites/educacloud-bo/app/OroRequirements.php(24): SymfonyRequirements->__construct()
#2 /Users/ale/Sites/educacloud-bo/app/oro-check.php(6): OroRequirements->__construct()
#3 {main}
thrown in /Users/ale/Sites/educacloud-bo/vendor/symfony/symfony/src/Symfony/Component/Intl/Collator/Collator.php on line 80

but I have installed intl extension:

# php -i | grep intl
 /usr/local/php5/php.d/50-extension-intl.ini,
 intl 
 intl.default_locale => it_IT => it_IT
 intl.error_level => 0 => 0

and php_info() on my browser give me these results:

version 1.1.0
ICU version 4.6
ICU Data version    4.6

What is the problem? thanks Alessandra

like image 279
Alessandra Avatar asked Sep 08 '14 12:09

Alessandra


People also ask

What is Intl extension in PHP?

The Internationalization extension (Intl) is a wrapper for the ICU library, a set of C/C++ and Java libraries that provide Unicode and Globalization support for software applications. It enables PHP programmers to perform UCA-conformant collation and date/time/number/currency formatting in their scripts.


2 Answers

By default, symfony2 is able to manage the "en" extension but to get other language, you have to install the php-intl extension.

The easiest option is to install it with the composer, because it expose global variable for you ... etc

All of this is explained here symfony/components/intl.

For the composer extension installation it's symfony/components/using_components.

So after eading this, you need to execute :

composer require symfony/intl

-- EDIT

Ok, I'm sorry, I've just test the solution, and the fact is : if you use the symfony component you have only access to "en". I have the same problem as you, my php5-intl extension was installed and activated but the error persisted. For me it was that I continue to write use Symfony\Component\Intl\DateFormatter\IntlDateFormatter; at the top of my file instead of using the basic php5 extension.

like image 167
Thomas Leduc Avatar answered Oct 05 '22 08:10

Thomas Leduc


Do one thing that might be helpful for resolve this error open php.ini file remove comment from ;extension=php_intl.dll

extension=php_intl.dll

and restart the Apache server

like image 38
pavan ganvani Avatar answered Oct 05 '22 06:10

pavan ganvani