cancel
Showing results for 
Search instead for 
Did you mean: 

indexer:reindex Uncaught Error: Class 'Locale' not found

SOLVED

indexer:reindex Uncaught Error: Class 'Locale' not found

I've ran a reindex via CLI today and getting

 

Design Config Grid index has been rebuilt successfully in 00:00:00

PHP Fatal error:  Uncaught Error: Class 'Locale' not found in /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/framework/Locale/Bundle/DataBundle.php:64

Stack trace:

#0 /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/framework/Locale/Bundle/DataBundle.php(28): Magento\Framework\Locale\Bundle\DataBundle->cleanLocale('en_US')

#1 /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/framework/Setup/Lists.php(92): Magento\Framework\Locale\Bundle\DataBundle->get('en_US')

#2 /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/framework/Validator/Locale.php(42): Magento\Framework\Setup\Lists->getLocaleList()

#3 /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/module-backend/Model/Locale/Resolver.php(72): Magento\Framework\Validator\Locale->isValid(NULL)

#4 /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/framework/Locale/Resolver.php(65): Magento\Backend\Model\Locale\Resolver->setLocale(NULL)

#5 /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/ in /home/sites/4a/9/95ad38fdbe/public_html/mgtrade/vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64

 

Someone has mentioned missing intl in PHP, but this is not correct as I've ran a phpinfo() and intl IS enabled:

 

intl
Internationalization support enabled
version 1.1.0
ICU version 4.2.1
Directive Local Value Master Value
intl.default_locale no value no value
intl.error_level 2 2
intl.use_exceptions 0 0

 

I'm running PHP 7.0.33

 

Thank you for any response. 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: indexer:reindex Uncaught Error: Class 'Locale' not found

Hi @Manthan Dave , 

 

I'm using a shared host and they've advised I need to use the full php path for it to work.

 

"When you use SSH you need to specify the full PHP path in the directory you are trying to execute the command."

 

In my instance I ran the following in the CLI and it worked a treat:

 

/usr/php70/usr/bin/php bin/magento indexer:reindex

 

Design Config Grid index has been rebuilt successfully in 00:00:00

Customer Grid index has been rebuilt successfully in 00:00:01

Category Products index has been rebuilt successfully in 00:00:00

Product Categories index has been rebuilt successfully in 00:00:00

Catalog Rule Product index has been rebuilt successfully in 00:00:01

Product EAV index has been rebuilt successfully in 00:00:00

Stock index has been rebuilt successfully in 00:00:00

Product Price index has been rebuilt successfully in 00:00:00

Catalog Product Rule index has been rebuilt successfully in 00:00:00

Catalog Search index has been rebuilt successfully in 00:00:00

View solution in original post

5 REPLIES 5

Re: indexer:reindex Uncaught Error: Class 'Locale' not found

Hello @andy _woodrow 

 

Are you using MAMP or XAMPP server or you are facing this error on the server ?

 

I understand the point - intl extension is enabled and its showing in the phpinfo as well.

 

But may your intl extension is not getting/added to bash_profile  and due to that you are facing this problem.

 

here i am sharing the link which might helps you to resolve the issue - https://www.codealist.com/magento-2-class-locale-not-found/

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: indexer:reindex Uncaught Error: Class 'Locale' not found

Hi @Manthan Dave , 

 

I'm using a shared host and they've advised I need to use the full php path for it to work.

 

"When you use SSH you need to specify the full PHP path in the directory you are trying to execute the command."

 

In my instance I ran the following in the CLI and it worked a treat:

 

/usr/php70/usr/bin/php bin/magento indexer:reindex

 

Design Config Grid index has been rebuilt successfully in 00:00:00

Customer Grid index has been rebuilt successfully in 00:00:01

Category Products index has been rebuilt successfully in 00:00:00

Product Categories index has been rebuilt successfully in 00:00:00

Catalog Rule Product index has been rebuilt successfully in 00:00:01

Product EAV index has been rebuilt successfully in 00:00:00

Stock index has been rebuilt successfully in 00:00:00

Product Price index has been rebuilt successfully in 00:00:00

Catalog Product Rule index has been rebuilt successfully in 00:00:00

Catalog Search index has been rebuilt successfully in 00:00:00

Re: indexer:reindex Uncaught Error: Class 'Locale' not found

Yes That correct solve my essue thank's a lot

Re: indexer:reindex Uncaught Error: Class 'Locale' not found

Great! It works for me. 

Thanks!

Re: indexer:reindex Uncaught Error: Class 'Locale' not found

Thanks, its helpfull.