Forums / Bug Reports / Site Crashed U_ILLEGAL_ARGUMENT_ERROR in IntlDateFormatter

Site Crashed U_ILLEGAL_ARGUMENT_ERROR in IntlDateFormatter

Views: 11,309

Results 41 to 44 of 44
16 May 2024, 10:00 AM
#41
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
413
Plugin Contributions:
6

Site Crashed U_ILLEGAL_ARGUMENT_ERROR in IntlDateFormatter

Georgecy:

Hi Guys,
timezone-identifiers available from @lat instructions are listed at the end. The important for my case is Asia/Nicosia, Europe/Athens, which are available.( Running Joomla 4 system report, on same PHP, it shows also Europe/Nicosia and UTC as default timezone. Joomla has no problem with the PHP 8.1.1).

The actual timezone declared in php.ini is date.timezone = "Europe/Athens"

The Intl extension is also available.
I entered also in php.ini
[intl]
intl.default_locale = el_GR.UTF-8 which it had no effect on the issue.

Attached also screenshot From info.php
Attachment 20608

Asia/Aden, Asia/Almaty, Asia/Amman, Asia/Anadyr, Asia/Aqtau, Asia/Aqtobe, Asia/Ashgabat, Asia/Atyrau, Asia/Baghdad, Asia/Bahrain, Asia/Baku, Asia/Bangkok, Asia/Barnaul, Asia/Beirut, Asia/Bishkek, Asia/Brunei, Asia/Chita, Asia/Choibalsan, Asia/Colombo, Asia/Damascus, Asia/Dhaka, Asia/Dili, Asia/Dushanbe, Asia/Famagusta, Asia/Gaza, Asia/Hebron, Asia/Ho_Chi_Minh, Asia/Hong_Kong, Asia/Hovd, Asia/Irkutsk, Asia/Jakarta, Asia/Jayapura, Asia/Jerusalem, Asia/Kabul, Asia/Kamchatka, Asia/Karachi, Asia/Kathmandu, Asia/Khandyga, Asia/Kolkata, Asia/Krasnoyarsk, Asia/Kuala_Lumpur, Asia/Kuching, Asia/Kuwait, Asia/Macau, Asia/Magadan, Asia/Makassar, Asia/Manila, Asia/Muscat, Asia/Nicosia, Asia/Novokuznetsk, etc...., Europe/Amsterdam, Europe/Andorra, Europe/Astrakhan, Europe/Athens, Europe/Belgrade, etc....

It seems your PHP compilation is missing ICU timezone data.
Here is what I get (ICU TZData version):
Attachment 20617

In PHP there are two time zone objects, DateTimeZone that you tested with lat9 test and IntlTimeZone. Normally Intl DateFormatter can use both, but it is possible that when it is not explicitly written in code, default might be IntlTimeZone that uses ICU time zone data missing in your PHP.
This might be your problem, not 100% sure though.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

16 May 2024, 11:38 AM
#42
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
413
Plugin Contributions:
6

Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR in IntlDateFormatter

You can try this code to test if ICU time zone data are here:

<?php
$zone_iter=IntlTimeZone::createEnumeration('GR'); // Create timezone iterator. To list one country time zones, use country code : 'Au', 'US', 'Fr', 'jp' ... For all countries, use NULL.
$zone_iter->rewind();
while($zone_iter->valid()){
    echo $zone_iter->current() . "\n";
   $zone_iter->next();
}
?>

You should get Europe/Athens if data are here, if not an error code or nothing.
You can replace 'GR' by 'CY' for Cyprus.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

21 May 2024, 8:21 AM
#43
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR in IntlDateFormatter

Hi Guys Thanks a lot for the support,
Finally I got today the requested PHP 8.1.28. With a note from the developer as follows

"It should solve all the PHP Intl extension issues you have experienced.
The problem was that for some obscure reasons, the Intl extension
shipping with all our packages were not able to read its localization
and timezone data despite it being available as a library."

After applying the @setlocale(LC_TIME, ['en_US', 'en_US.UTF-8', 'en-US']); in configures we are back in Business.
The developer recommended to use PHP8.2+ and I will test the latest version as soon as I receive it.

Now is it recomended to skip ZC 1.5.8 and upgrade straight to ZC 2.01 from ZC1.5.7d? Or is safer to go to 1.5.8a for more compatibility?

Thanks a lot again.

21 May 2024, 9:13 AM
#44
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,727
Plugin Contributions:
56

Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR in IntlDateFormatter

Now is it recomended to skip ZC 1.5.8 and upgrade straight to ZC 2.01 from ZC1.5.7d?

Yes.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.