'php - Fatal error: Uncaught Error: Class 'IntlDateFormatter' not found in C:\Users\denni\PhpstormProjects\ACNOP OOP\Main.php on line 69
I'm trying to use the IntlDateFormatter class to format date and time strings to local (Dutch) time formats. I use the following code that I copy-pasted from https://www.simonholywell.com/post/2015/07/international-php-dates-with-intl/ into my Main class:
$DateTime = new DateTime();
$IntlDateFormatter = new IntlDateFormatter(
'es_ES',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL
);
echo $IntlDateFormatter->format($DateTime);
But I get the following errors:
Fatal error: Uncaught Error: Class 'IntlDateFormatter' not found in C:\Users\denni\PhpstormProjects\ACNOP OOP\Main.php on line 69
Error: Class 'IntlDateFormatter' not found in C:\Users\denni\PhpstormProjects\ACNOP OOP\Main.php on line 69
I already tried to uncomment the line ;extension=php_intl.dll
so that it becomes extension=php_intl.dll
, but that did not help.
What do I need to do?
I use PHPStorm, just in case if that is important
Thanks in advance.
Solution 1:[1]
it is necessary to go on xampp, apache, config, to seek PHP (php.ini) click on it, then to seek (;extension=intl), to withdraw the ';' then to record. return on apache in xampp and stop then start. return on your page the problem must be solved
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Imad Eddine |