Zen Cart Logo
Forums / Bug Reports / IntlDateFormatter php issue

IntlDateFormatter php issue

Locked

Views: 2,167

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
2 Nov 2023, 4:16 PM
#1
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

IntlDateFormatter php issue

ZC 1.5.8 (probably others too)
Due to changes of IntlDateFormatter in PHP 8.1.25 8.2.12
any store updating to those new releases of PHP will get a server 500 error, and logs like below.
Here it the github info on the change : https://github.com/php/php-src/issues/12561
What I don't know is what we have to change to fix it.

Sort term answer is drop down to PHP 8.0

[02-Nov-2023 10:05:18 America/New_York] Request URI: /manufactuername-m-1.html, IP address: 11.22.33.44
--> PHP Fatal error: Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR in /home/account/www.website.com/includes/classes/zcDate.php:87
Stack trace:
#0 /home/account/www.website.com/includes/classes/zcDate.php(87): IntlDateFormatter->__construct('C', 3, -1)
#1 /home/account/www.website.com/includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()
#2 /home/account/www.website.com/includes/autoload_func.php(47): zcDate->__construct()
#3 /home/account/www.website.com/includes/application_top.php(237): require('/home/account...')
#4 /home/account/www.website.com/index.php(25): require('/home/account...')
#5 {main}
  thrown in /home/account/www.website.com/includes/classes/zcDate.php on line 87.
22 Feb 2024, 10:55 AM
#3
swguy avatar

swguy

Administrator

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

Re: IntlDateFormatter php issue

The fix for this issue from Dr. Byte is as follows:

Zen Cart 1.5.8/1.5.8a users: Add this to the end of includes/configure.php and YOUR_ADMIN/includes/configure.php:

@setlocale(LC_TIME, ['en_US', 'en_US.UTF-8', 'en-US']);

This issue is handled in 2.0.0 without the requirement for these changes.