Hello friends in today’s post we are going to see how to resolve “Fatal error: Class IntlDateFormatter not found” error. Magento basically requires a list of PHP extensions to be installed in the server in order to work properly and if any one of the extension is missing it would start to throw out errors and the entire website might not work properly.
If the php-intl extension is missing in your server this issue would arise and an error similar to the following would start to show up:
Fatal error: Class 'IntlDateFormatter' not found in vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php on line 93
Resolving Class IntlDateFormatter not found:
This issue as started above is occuring because on the mandatory required PHP extensions is missing and it is nothing but the php-intl which contains all the functions related to Internationalisation.
In order to install the intl PHP extension you will first need to identify the version of PHP installed in your machine. You can identify the version of PHP in your local machine or server by running the following command:
php -v
Once you execute the above command, it will display the version of PHP like shown in the following screenshot:
In my case the PHP version is 8.2 and hence need to install the intl PHP extension compatible for the PHP version 8.2. In order to install the intl extension compatible for the PHP 8.2 version, execute the following command:
sudo apt install php-intl php8.2-intl
This will install the intl (PHP Internationalisation) extension in your linux machine. According to your version of PHP installed in your local machine, you will need to change the version number by replacing the 8.2 with your version number. Once this extension is installed, you can refresh the magento cache using cli command and try reloading the page.