2

Since I updated my project from symfony 4.4 to 5.0, I have on all my pages the following deprecation warning (only warning I'm having) :

Please install the "intl" PHP extension for best performance.

After searching for a solution, I thought that I needed to install the intl component, which I did :

composer require symfony/intl

I also installed the symfony/translation component :

composer require symfony/translation

The problem is the deprecation is still here (even after bin/console cache:clear and restarting symfony serve).

yivi
  • 42,438
  • 18
  • 116
  • 138
  • If this is a warning, simply ignore it. Otherwise, why not just follow the recommendation - "best performance" sounds like something worth to achieve? – Nico Haase Oct 15 '20 at 06:26
  • The problem with leaving a warning is that you don't pay attention to new warnings => the little orange button isn't that different with "1" or "2" on it. I like to keep the number of warnings to 0 ; it's time consuming during development but it makes me gain time in the end. – Diabetic Nephropathy Oct 15 '20 at 11:42
  • Then don't ignore the warning and install the extension, simple as that – Nico Haase Oct 15 '20 at 12:00
  • I managed to install it as I said in my comment of the solution answer. And "simple as that" -> depending on configuration, installing intl PHP extension on macOS Catalina isn't as simple as it sounds… (see my other comment for more detail) – Diabetic Nephropathy Oct 15 '20 at 12:03
  • Pretty strange. How did you install PHP after all? According to https://stackoverflow.com/questions/46652968/install-intl-php-extension-osx-high-sierra, it's as simple as installing PHP through Brew and Intl is activated – Nico Haase Oct 15 '20 at 12:19
  • There is the macOS version of PHP (7.3.8) which suited my needs with the build-in symfony server. When I tried to compile with pecl the intl extension, I faced the "non php.h file found" ; exception on macOS that seems to be more recent than your link and seems to be linked with the fact that pecl is superseded. Maybe with Brew I messed up something (even if I think it's unlikely) but I still had Symfony's deprecation warning when using Brew's php. Once I used MAMP's PHP (7.3.8) currently built-in with the intl extension, no more deprecation warning ; and `php -m | grep intl` confirmed that. – Diabetic Nephropathy Oct 15 '20 at 12:30

1 Answers1

9

You need to install intl PHP extension instead of Symfony component symfony/intl

See manuals for installation on your OS. For example on Ubuntu/Debian

sudo apt-get install php-intl

Check if extension installed

php -m | grep intl
intl # must be printed this line with extension name

Official documentation page for this extension https://www.php.net/manual/en/intl.installation.php

  • 1
    Thanks ! It was a hastle to install the intl extension on Catalina (brew doesn't seem to distribute php extensions anymore & pecl compilation doesn't seem to work on recent macOS versions…), but after several hours I managed to have the extension ! And the warning/deprecation is gone ! Nice ! If others are having the same problems as me to install the php-intl extension on a recent macOS : passing by the MAMP version of PHP 7.x seems to have done the trick ! And no need to add anything to the project's php.ini. – Diabetic Nephropathy Oct 15 '20 at 11:47
  • If the "libicu-dev" package is not installed, you need to install it: `apt-get install libicu-dev` before installing PHP extension "intl". – Maxim Mandrik Oct 13 '21 at 16:27