68

Using the CakePHP docs, I am trying to install 3.0-beta2 using composer but I got this error:

cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system

However, I know for sure that intl is installed (it shows on phpinfo). I'm using PHP 5.4.33/Apache 2.4.10.1

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Juan Carlos
  • 1,073
  • 1
  • 9
  • 13
  • 2
    Is it the bundled version (PHP compiled with `--enable-intl`) or the PECL one? And what does `extension_loaded('intl')` say (on the CLI)? Also is your CLI using the same PHP version/configuration as Apache? – ndm Oct 09 '14 at 18:26
  • 1
    Thanks @ndm, you actually gave me a hint for the solution: intl was not enabled in php_cli.ini. Everything is ok now. – Juan Carlos Oct 09 '14 at 19:41
  • 1
    You're welcome. Either one of us should add that as answer so that the question appears resolved. – ndm Oct 09 '14 at 20:23
  • 1
    @JuanCarlos Could you mark an answer as correct if it worked? – Tijme Nov 11 '15 at 10:58

18 Answers18

119

I faced the same problem today. You need to enable the intl PHP extension in your PHP configuration (.ini).

Solution Xampp (Windows)

  1. Open /xampp/php/php.ini
  2. Change ;extension=php_intl.dll to extension=php_intl.dll (remove the semicolon)
  3. Copy all the /xampp/php/ic*.dll files to /xampp/apache/bin
  4. Restart apache in the Xampp control panel

Solution Linux (thanks to Annamalai Somasundaram)

  1. Install the php5-intl extension sudo apt-get install php5-intl

    1.1. Alternatively use sudo yum install php5-intl if you are on CentOS or Fedora.

  2. Restart apache sudo service apache2 restart

Solution Mac/OSX (homebrew) (thanks to deizel)

  1. Install the php5-intl extension brew install php56-intl
  2. If you get No available formula for php56-intl follow these instructions.
  3. Restart apache sudo apachectl restart

Eventually you can run composer install to check if it's working. It will give an error if it's not.

Tijme
  • 39
  • 2
  • 24
  • 41
  • 1
    In my version of xampp 5.5.0.0 the dll files where already there and i didn't have to copy it – user1767754 Sep 15 '15 at 05:17
  • Its working for me,but one error is coming [InvalidArgumentException] Project directory Cake3/ is not empty. – sradha Feb 08 '16 at 09:56
  • I am facing this in macos. How do I solve this in mac ? – Dashrath Feb 26 '16 at 10:05
  • It's possible that you get the following error by installing the extension with HomeBrew on macOS Sierra: "Error: No available formula with the name "php56-intl" ==> Searching for similarly named formulae... Error: No similarly named formulae found." To fix this, type "homebrew/php/php56-intl". – CodeWhisperer Nov 01 '16 at 09:37
  • Thanks for the solution. I have installed xampp 5.6.30 and got the same probleme with my cakephp project. I just enable the intl PHP extension. The dll files where already there and i didn't have to copy them. – Mustafa May 07 '17 at 15:15
  • 2
    On Mac OS, if you get `No available formula`, you can run `brew tap homebrew/homebrew-php`, then run it again. – Don P Nov 11 '17 at 04:11
  • it worked thanks for detailing the steps for newBee – Sjd May 29 '19 at 09:12
14

I faced the same issue in ubuntu 12.04

Installed: sudo apt-get install php5-intl

Restarted the Apache: sudo service apache2 restart

AnNaMaLaI
  • 4,064
  • 11
  • 53
  • 93
8

When using MAMP

1 Go to terminal

vim ~/.bash_profile

i

export PATH=/Applications/MAMP/bin/php/php5.6.2/bin:$PATH

Change php5.6.2 to the php version you use with MAMP

Hit ESC, Type :wq, hit Enter

source ~/.bash_profile

which php

2 Install Mac Ports

https://www.macports.org/install.php

sudo port install php5-intl OR sudo port install php53-intl

cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/

{take a good look at the folder names that u use the right ones}

3 Add extension

Now, add the extension to your php.ini file:

extension=intl.so

Usefull Link: https://gist.github.com/irazasyed/5987693

Pradeep Singh
  • 1,282
  • 2
  • 19
  • 35
Gilko
  • 2,280
  • 8
  • 36
  • 45
  • I followed the **2 Install Mac Ports** installed intl, copied in extensions, added the extension in php.ini. But its not working. I am using Xampp – Pradeep Singh Nov 24 '15 at 05:07
  • This also works for XAMPP 7.4.2 - used port to install php74-intl, then renamed the file to php_intl.so and copied it to: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/ – Thomas Gatt Feb 24 '20 at 12:11
8

OS X Homebrew (May 2015):

The intl extension has been removed from the main php5x formulas, so you no longer compile with the --enable-intl flag.

If you can't find the new package:

$ brew install php56-intl
Error: No available formula for php56-intl

Follow these instructions: https://github.com/Homebrew/homebrew-php/issues/1701

$ brew install php56-intl
==> Installing php56-intl from homebrew/homebrew-php
deizel.
  • 11,042
  • 1
  • 39
  • 50
3

The error message clearly states what the problem is. You need the intl extension installed.

Step 1: install PHP intl you comfortable version

$sudo apt-get install php-intl

step 2:

For XAMPP Server intl extension is already installed, you need to enable this extension to uncomment below the line in your php.ini file. Php.ini file is located at c:\xampp\php\php.ini or where you have installed XAMPP.

Before uncomment:

;extension=php_intl.dll ;extension=php_mbstring.dll

After uncommenting:

extension=php_intl.dll extension=php_mbstring.dll

venkatskpi
  • 800
  • 6
  • 8
2

Short answer: activate intl extension in php_cli.ini. Thanks to @ndm for his input.

Juan Carlos
  • 1,073
  • 1
  • 9
  • 13
2

If you are using latest version Ubuntu 16.04 or later just do

sudo apt-get install php-intl

Then restart your apache

sudo service apache2 restart
Bijaya Kumar Oli
  • 2,007
  • 19
  • 15
1

In my case I was not actually trying to run cakephp locally, I was just trying to get it to auto update locally using composer (because I am playing with writing plugins that you install with composer). Since I don't actually even run it locally I could simply ignore requirements by adding the --ignore-platform-reqs flag.

php composer.phar update --ignore-platform-reqs

Richard
  • 5,584
  • 1
  • 19
  • 22
1

In my case, my running php version is 7.1.x on mac OSX . I installed intl command using brew install php71-intl. Placing extension=intl.so inside php.ini was no effect at all. Finally i looked for extension installed directory and there i saw intl.so and placed that path (extension=/usr/local/Cellar/php71-intl/7.1.11_20/intl.so) to my php.ini file and it solved my problem.

sh6210
  • 4,190
  • 1
  • 37
  • 27
1

In my case (xampp PHP 8.0)
Find ;extension=intl in /xampp/php/php.ini
Remove ; and Restart Apache

Huy
  • 426
  • 5
  • 12
0

MAKE this

In XAMPP, intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel. In WAMP, the intl extension is “activated” by default but not working. To make it work you have to go to php folder (by default) C:\wamp\bin\php\php{version}, copy all the files that looks like icu*.dll and paste them into the apache bin directory C:\wamp\bin\apache\apache{version}\bin. Then restart all services and it should be OK.

if you use XAMPP do this 1. turn off XAMPP 2. Modifed the php.ini is located in c/:xampp/php/php.ini 3. intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.

0

For Ubuntu terminal:

Please follow the steps:

Step-1:

cd ~

Step -2: Run the following commands

sudo apt-get install php5-intl

Step -3: You then need to restart Apache

sudo service apache2 restart


For Windows(XAMPP) :

Find the Php.ini file:

/xampp/php/php.ini

Update the php.ini file with remove (;) semi colon like mentioned below:

;extension=php_intl.dll to extension=php_intl.dll

and save the php.ini file.

After that you need to

Restart the xampp using xampp control.

kamlesh
  • 38
  • 4
0

Intl Means :Internationalization extension which enables programmers to perform UCA-conformant collation and number,currency,date,time formatting in PHP scripts.

To enable PHP Intl with PECL can be used.

pecl install intl

On a plain RHEL/CentOS/Fedora, PHP Intl can be install using yum

yum install php-intl

On Ubuntu, PHP Intl can be install using apt-get

 apt-get install php5-intl

Restart Apache service for the changes to take effect.

That's it

raju gupta
  • 59
  • 1
  • 5
0

For those who get Package not found error try sudo apt-get install php7-intl then run composer install in your project directory.

Kunok
  • 8,089
  • 8
  • 48
  • 89
0

I had the same problem in windows The error was that I had installed several versions of PHP and the Environment Variables were routing to wrong Path of php see image example

JimRod
  • 1
  • 4
0

I'm using Mac OS High Sierra and none of these worked for me. But after searching a lot I found one that worked!

This may seem trivial, but in fact about 2 months ago some clever guys made changes in brew repository, so doing just: brew install php71-intl will show you error with message that such recipe doesn’t exists.

Fortunately, there is. There is temporary fix in another brew repo, so all you have to do is:

brew tap kyslik/homebrew-php
brew install kyslik/php/php71-intl

SOURCE: http://blastar.biz/2018/04/14/how-to-enable-php-intl-extension-for-php-7-1-using-xampp-on-macos-high-sierra/

0

I use Linux Ubuntu 20, you can try this:

Check php installed modules:
php -m | grep intl

If there are no result(s) from this command, you should just go ahead and install the module:
sudo apt-get install php7.4-intl
you will need to change *php7.4 to your desired php version.

you should restart apache when you're done:
sudo service apache2 restart

Ekfinbarr
  • 41
  • 3
0

For fedora linux, with nginx and php-fpm, you can install with:

$ dnf install php-intl

No nginx restart is needed here.

Aris
  • 4,643
  • 1
  • 41
  • 38