Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install PHP intl extension in Ubuntu 14.04

I have a hard time to find exact method to install PHP intl extension in Ubuntu 14.04.

I tried with sudo apt-get install php5-intl but displays error Unable to locate package.

I really need this extension for Zend Framework 2 , because of above missing extension I am getting error like this

ERROR: Zend\I18n\Validator component requires the intl PHP extension

I am using PHP 5.5.9.

How can I install PHP-intl extension in a correct way ?

like image 960
Hiranya Sarma Avatar asked Feb 15 '17 07:02

Hiranya Sarma


People also ask

What is Intl PHP extension?

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.

How do you check PHP extension is enabled in Ubuntu?

It is possible that an installed module has been disabled. In that case, it won't show up when running php -m , but it will show up in the list of installed Ubuntu packages. Modules can be enabled/disabled via the php5enmod tool ( phpenmod on later distros) which is part of the php-common package.


2 Answers

For php5 on Ubuntu 14.04

sudo apt-get install php5-intl 

For php7 on Ubuntu 16.04

sudo apt-get install php7.0-intl 

For php7.2 on Ubuntu 18.04

sudo apt-get install php7.2-intl 

Anyway restart your apache after

sudo service apache2 restart 

IMPORTANT NOTE: Keep in mind that your php in your terminal/command line has NOTHING todo with the php used by the apache webserver!

If the extension is already installed you should try to enable it. Either in the php.ini file or from command line.

Syntax:

php:

phpenmod [mod name] 

apache:

a2enmod [mod name] 
like image 157
Spears Avatar answered Oct 01 '22 05:10

Spears


install it from terminal

sudo apt-get install php-intl 
like image 37
Abdallah Awwad Alkhwaldah Avatar answered Oct 01 '22 06:10

Abdallah Awwad Alkhwaldah