How do I enable the intl extension in CakePHP?

Viewed 19969

I am using CakePHP 3 and MAMP Pro server for my project. When I am trying to bake the cake, this error shows up:

Fatal error: You must enable the intl extension to use CakePHP.

I have even included intl.so and extension=php_intl.dll in my php.ini file but couldn't figure out solution for this error.

4 Answers

this issue was happening to me some days ago. I had installed Ubuntu 18.04 and php 7.1.

I was trying to run the comman php cake.php bake in orden to use cakephp's console but I was getting the following error message:

  • You must enable the intl extension to use CakePHP.

This extension (intl) was installed for php 7.1 (php7.1-intl) but this message was appearing every time I used php cake.php bake

After some google searches, I saw that I have to install the extension but with the following command:

sudo apt-get install php-intl

The same issue happened with mbstring extension, I used the command:

sudo apt-get install php-mbstring

then I restarted the apache server with:

sudo service apache2 restart

I had the same issue. After starting from scratch, I did :

$ brew install php
$ composer install && composer update && composer dump-autoload --optimize
$ composer self-update && composer create-project --prefer-dist cakephp/app:^3.8 cms
$ cd cms
$ bin/cake server

And it was working !

I faced the same issue.

I added extension="php_intl.dll" in php.ini and restarted the Apache server.

Now it is working.

Related