phpubuntuinternationalizationwampamazon-linux

Fatal error: Class 'IntlDateFormatter' not found


I installed WAMP on my local machine. My PHP version is 5.3.3 in phpinfo() but that extension doesn't exist! :(

How can I install this extension without compiling it? Here is just source of it.


Solution

  • The extension was there! All you need to do is clearing the comment(;) before this line in php.ini file:

    Windows:

    ;extension=php_intl.dll
    

    to

    extension=php_intl.dll
    

    Linux:

    ;extension=intl
    

    to

    extension=intl
    

    Then restart apache2 or php-fpm if you are using it.

    If it does not work, then you probably need to change it in the php.ini of the CLI version. First check your version with php --version though, so that you change the right php.ini file, it might be different from your php fpm version.

    It also might be enough to just install the package e.g. for php 8.2: sudo apt install php8.2-intl