I have this error:

Fatal error: Class 'Locale' not found in vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64

in Magento 2 when I try do use this command to clear the cached files:

php bin/magento setup:static-content:deploy

Does anyone else have this problem?

Later Edit: I want to regenerate the static content, it was a bad wording before. I am using Magento 2.0.2 and I used the downloaded file from magento.com

  • But php bin/magento setup:static-content:deploy is not the right command to clear cache files. It creates/regenerates the static content. Also, can you specify what version of Magento2, and how did you deploy? via git, composer create project or downloaded a zip from magento.com? – Maddy Mar 30 '16 at 15:25

You php do not have intl extension. You can verify it by run php -i.

In many cases this problem appear when you have different php version/configurations for apache and cli. For example if use install MAMP on MacOsX that you will have different version. To use php in this case you need specify full path to php like /Applications/MAMP/bin/php/php7.0.0/bin/php

To change it you need to do folowing steps:

Edit ~/.bash_profile and add

export PATH=/Applications/MAMP/bin/php/php7.x.x/bin:$PATH

where /Applications/MAMP/bin/php/php7.x.x should be patch to your latest wersion

In Terminal, run source ~/.bash_profile

In Terminal, type in which php and look for the updated patch. If everything was successful, It should output the new path to MAMP PHP install.

In case it doesn't output the correct path, try closing the terminal window (exit fully) and open again, it should apply the changes (Restart in short).

| improve this answer | |

This error occurs when you do not have php's intl extension. Please install this according to your OS and PHP Version. Here are instructions for Ubuntu and Centos.

How did you install Magento 2? via CLI or Web?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.