4

On submitted contribution pages, I get a fatal php error "unconstructed IntlDateFormatter." At first I thought the answer was a simple case of a missing php-intl extension. However, it is there. That has brought me up short. Searching this site and the web generally comes up with plenty of cases where Intl is missing, but I can also see that in those cases the error is that it is missing not "unconstructed." I am completely mystified as to what the problem is. I'm hoping someone here has an idea. Here is the Apache error log:

[Mon Nov 27 20:46:49.071498 2023] [proxy_fcgi:error] [pid 2064307:tid 140013073311424] [client 142.113.152.41:60473] 
AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Found unconstructed IntlDateFormatter in /var/www/civi.sitename.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php:105
Stack trace:
#0 /var/www/civi.sitename.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php(105): IntlDateFormatter->format()
#1 /var/www/civi.sitename.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php(204): PHP81_BC\\{closure}()
#2 [internal function]: PHP81_BC\\{closure}()
#3 /var/www/civi.sitename.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php(185): preg_replace_callback()
#4 /var/www/civi.sitename.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/log/Log.php(887): PHP81_BC\\strftime()
#5 /var/www/civi.sitename.org/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/log/Log/file.php(294): Log->formatTime()
#6 /var/www/civi.sitename.org/wordpress/wp-content/plugins/...', referer: https://civi.sitename.org/civicrm/contribute/transact/?_qf_Confirm_display=true&qfKey=CRMContributeControllerContribution187bnnkv5540g8sk0cok0g04owsc8gcosog88k8cs84808w4ok_5444

No entry in the CiviCRM log.

Tried with both PHP 8.1.26 and 8.2.13. Works fine with PHP 7.4. Current php extension list is a perfect match for php-7.4 on the same server except for php-json which seems to be baked in starting with version 8.

I'm running Civi 5.66.1 on WordPress 6.4.1.

1 Answer 1

4

See https://lab.civicrm.org/dev/core/-/issues/4739.

If you want to stay on 5.66 instead of upgrading to 5.67 you have some choices:

(It should work with php 8.1.26 too since they released a temp patch, but you said you tried so I'm not sure about that.)

1
  • 1
    I've just hit this in CiviCRM 5.63.4. With PHP 8.1.25 you get datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR With PHP 8.1.26 you get Found unconstructed IntlDateFormatter In both cases applying the patch fixes the issue. Commented Dec 13, 2023 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.