user2818060
user2818060

Reputation: 845

How to solve the issue - please install the "intl" extension for full localization capabilities

What i Need

The code i have implemented:

use Symfony\Component\Intl\Intl;
                
\Locale::setDefault('en');
$currencies = Intl::getCurrencyBundle()->getCurrencyNames();

$currency = Intl::getCurrencyBundle()->getCurrencyName('INR');

$symbol = Intl::getCurrencyBundle()->getCurrencySymbol('INR');

$fractionDigits = Intl::getCurrencyBundle()->getFractionDigits('INR');

$roundingIncrement = Intl::getCurrencyBundle()->getRoundingIncrement('INR');
              

Error:

The Symfony\Component\Intl\Locale\Locale::setDefault() is not implemented. Please install the "intl" extension for full localization capabilities.

500 Internal Server Error - MethodNotImplementedException

OS configuration:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
NAME="Ubuntu"
VERSION="13.04, Raring Ringtail"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.04"
VERSION_ID="13.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Upvotes: 18

Views: 48337

Answers (8)

Mart-Jan
Mart-Jan

Reputation: 67

For docker with fpm it is:

FROM php:8.1-fpm

RUN apt-get install -y libicu-dev
RUN docker-php-ext-install intl

Thanks to https://askubuntu.com/a/243663/739270

Upvotes: 0

Haki Dere
Haki Dere

Reputation: 21

For docker image php:5.6-apache this solved the problem for me

So I added these to my config:

  - run: sudo apt-get update
  - run: sudo apt-get install -y zlib1g-dev libicu-dev g++
  - run: sudo docker-php-ext-configure intl
  - run: sudo docker-php-ext-install intl

Reference: https://discuss.circleci.com/t/cannot-install-php-intl-on-php7-2-image/20528/5

Upvotes: 1

Michael Sivolobov
Michael Sivolobov

Reputation: 13265

UPDATED for new versions of PHP:

You can install intl extension for your current php version by this command:

sudo apt-get install php-intl

If you need to install php-intl not only for current selected PHP-version you can pass php version right after php word:

sudo apt-get install php7.4-intl    # for PHP version 7.4
sudo apt-get install php8.1-intl    # for PHP version 8.1

If you use Apache server with mod_php don't forget to restart it:

sudo apachectl restart

Original Answer

You need just put one line to the terminal:

sudo apt-get install php5-intl

Upvotes: 26

Priya
Priya

Reputation: 1554

If someone facing this issue in docker mode, for docker instances of php8.x please use this

docker-php-ext-install intl

Upvotes: 4

Neeraj Tangariya
Neeraj Tangariya

Reputation: 1407

Open XAMPP server. click on Apache config button And open php.ini file. enter image description here Under php.ini file search intl And uncommented out the line. And restart the server. enter image description here Hope this would be helpful.

Upvotes: 1

Azhar Khattak
Azhar Khattak

Reputation: 875

Extending the Answer by Michael Sivolobov, for php7 on debian 9 /stretch

sudo apt-get install php7.0-intl

or simply

sudo apt-get install php-intl

then

sudo service apache2 restart

Thanks!

Upvotes: 17

Dung
Dung

Reputation: 20565

If you are using XAMPP on windows here is how:

open for example c:\xampp\php\php.ini and remove the semi colon ";" in front of "extension=php_intl.dll" save the file and restart apache.

That will get solve the error message.

Done.

Upvotes: 8

Evgeny Melnikov
Evgeny Melnikov

Reputation: 1092

When I tried to install intl on Ubuntu 16.04 with:

sudo apt-get install php5-intl

I've got an error like:

error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works. ERROR: `/tmp/pear/temp/intl/configure --with-php-config=/usr/bin/php-config --with-icu-dir=DEFAULT' failed

In order to solve the problem I needed to install:

sudo apt-get install libicu-dev

and after that install

sudo apt-get install php5-intl

That solved my problem.

Upvotes: 2

Related Questions