Solved: PHP Fatal Error Class ‘locale’ Not Found in Magento 2
Getting Magento 2 installed is not that easy, especially when you are a beginner or don’t have much technical knowledge or coding skills.
If it is the case, you may be frightened by errors and warnings you face in Magento 2. Installing Magento 2 is a more complex process than other eCommerce platforms out there in the market.
To do so, you must have solid coding skills or experience in Magento 2.
Well, in this blog post, I will explain how to fix the error, which says,
Fatal error: Class ‘Locale’ not found in vendor/magento/framework/Locale/Bundle/DataBundle.php
This error often occurs when you install Magento 2.3.5 or above versions using XAMPP.
The error is with Xampp as it does not include the php.ini file by default. The file is located in the root directory of Xampp.
As you know that Magento 2.3.5 and higher versions require the "intl" extension, so the best way to obtain it is by enabling it in the php.ini file.
To avoid this issue and install the Magento 2 without any problems, you can follow any below methods.
Solution for PHP Fatal Error Class ‘locale’ Not Found in Magento 2 in Xampp/Wamp:
The following is the solution to the problem PHP Fatal Error Class "locale" Not Found in Magento 2:
- Find the line ;extension=php_intl.dll or ;extension=intl in php.ini file.
- Save the file after removing (;).
- Restart the Xampp or Wamp server and refresh the installation page.
Solution for PHP Fatal Error Class ‘locale’ Not Found in Magento 2 in Ubuntu
- Open Terminal and run the below commands
sudo apt-get update -y
sudo apt-get install -y php-intl
Note: -y flag means to assume yes and silently install, without asking you questions in most cases.
And that’s it! You’re done!!
If you have any questions or face any problems, please do let us know in the comment section below. We would be happy to listen to you.
Feel free to share this solution among the Magento community or friends via social media channels.