Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Quote:
Originally Posted by
lat9
Noting that the zcDate.php class is PHP version-specific, using strftime for PHP versions < 8.1 and using the IntlDateFormatter class (if that PHP extension is installed) otherwise.
I did not do detailed explanation as it was already explained few month ago but I made it backward compatible. It uses IntlDateFormatter (PHP >=5.3.0 with PECL >=1.0.0) if avialable as it is possible (although very rare) to remove this extension in PHP settings, then date_format (PHP >= 5.2.0) if not. Strftime % parameters are accepted as input parameters.
Compatibility should go back to ZenCart 1.3.9 although I did not test it and won't... This was made for Zencart 1.5.8 (PHP >= 7.3) and above anyway.
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
post 7 by dr byte fixed this issue for me.
for those reading/searching on solution why php 8.1 and 8.2 white screens the site and php 8.0 works fine.
fresh install tested. 1.5.8a
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Quote:
Originally Posted by
DrByte
My bad. Turns out 'en' alone isn't "valid" either. And that's what I had in my clipboard when I pasted. Doh!
EDITED: now recommending:
Code:
@setlocale(LC_TIME, ['en_US', 'en_US.UTF-8', 'en-US']);
Add this to the end of includes/configure.php and YOUR_ADMIN/includes/configure.php
That fix for a blank store with the log "Uncaught Error: Found unconstructed IntlDateFormatter" worked for me! I changed the two cofigure.php files and now both the customer-facing page and the admin page load on my test install.
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Quote:
Originally Posted by
DrByte
My bad. Turns out 'en' alone isn't "valid" either. And that's what I had in my clipboard when I pasted. Doh!
EDITED: now recommending:
Code:
@setlocale(LC_TIME, ['en_US', 'en_US.UTF-8', 'en-US']);
Add this to the end of includes/configure.php and YOUR_ADMIN/includes/configure.php
That fixed worked for me when the customer-facing page and the admin page were both blank and the log listed an "Uncaught Error: Found unconstructed IntlDateFormatter". Thanks.
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Hi Guys,
I tested 1.5.8a fresh install with PHP 8.11 and tested all patches without sucess. When using PHP 7.4 all it works without problem. I assume if PHP 8.0 is used it will also work, as per other forum posts(also tested php 8.010 and it works). 2.0 is supposed to solve this issue. The important question for us is the compatibility of the plug ins in version 1.5.8a and 2.0. If the plugins are compatible with both these versions then we go straight to version 2.0. If not we have to sort out the issues with 1.5.8 till the 2.0 with our pluggins are compatible. Any hints of what we maybe doing wrong with the PHP 8.1+ patch is welcome.
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Quote:
Originally Posted by
Georgecy
Hi Guys,
I tested 1.5.8a fresh install with PHP 8.11 and tested all patches without sucess. When using PHP 7.4 all it works without problem. I assume if PHP 8.0 is used it will also work, as per other forum posts(also tested php 8.010 and it works). 2.0 is supposed to solve this issue. The important question for us is the compatibility of the plug ins in version 1.5.8a and 2.0. If the plugins are compatible with both these versions then we go straight to version 2.0. If not we have to sort out the issues with 1.5.8 till the 2.0 with our pluggins are compatible. Any hints of what we maybe doing wrong with the PHP 8.1+ patch is welcome.
I'm not clear on what the issue you're facing is; see post #24 in this thread ... has that change provided by DrByte been applied?
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Hi Cindy,
The patch @setlocale(LC_TIME, ['en_US', 'en_US.UTF-8', 'en-US']); has been applied to both configure files without success. I initially use GB instead of US but at the end I used the exact statement above. I tried also to changed the Time Zone to Europe/Athens but without success.
[09-May-2024 17:05:51 Europe/Athens] PHP Fatal error: Uncaught IntlException: datefmt_create: No such time zone: 'Europe/Athens': U_ILLEGAL_ARGUMENT_ERROR in /includes/classes/zcDate.php:90
When going back to PHP 7.4 or 8.0 the blank pages go away and the the store works as expected.
The logs are the shown below
[09-May-2024 13:32:46 UTC] PHP Fatal error: Uncaught IntlException: datefmt_create: No such time zone: 'UTC': U_ILLEGAL_ARGUMENT_ERROR in /includes/classes/zcDate.php:90
Stack trace:
#0 /includes/classes/zcDate.php(90): IntlDateFormatter->__construct()
#1 /includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()
#2 /includes/autoload_func.php(47): zcDate->__construct()
#3 /admin!/includes/application_top.php(42): require('...')
#4 /admin!/login.php(8): require('...')
#5 /admin!/index.php(11): require('...')
#6 {main}
thrown in /includes/classes/zcDate.php on line 90
[09-May-2024 13:32:46 UTC] Request URI: /admin!/index.php?cmd=login&camefrom=index.php, IP address: xxxxxxx
--> PHP Fatal error: Uncaught IntlException: datefmt_create: No such time zone: 'UTC': U_ILLEGAL_ARGUMENT_ERROR in /includes/classes/zcDate.php:90
Stack trace:
#0 /includes/classes/zcDate.php(90): IntlDateFormatter->__construct()
#1 /includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()
#2 /includes/autoload_func.php(47): zcDate->__construct()
#3 /admin!/includes/application_top.php(42): require('...')
#4 /admin!/login.php(8): require('...')
#5 /admin!/index.php(11): require('...')
#6 {main}
thrown in /includes/classes/zcDate.php on line 90.
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Still trying to figure out what's going on. This link: https://github.com/zencart/zencart/b...te.php#L87-L91
... identifies lines 87 through 91 of the zcDate.php class for zc158a. The fact that your logs show an issue being thrown on line 90 is what's (er) throwing me off.
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Setting on line 90 'none' means it uses PHP's or system's default. There might be some bad setting in php.ini or somewhere on the server, just an idea.
Re: Site Crashed U_ILLEGAL_ARGUMENT_ERROR
Quote:
Originally Posted by
pilou2
Setting on line 90 'none' means it uses PHP's or system's default. There might be some bad setting in php.ini or somewhere on the server, just an idea.
The error getting thrown could be the result of date.timezone not being set correctly in php.ini.