Answers.Body: <p>See <a href="https://lab.civicrm.org/dev/core/-/issues/4739" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/issues/4739</a>.</p>
  <p>If you want to stay on 5.66 instead of upgrading to 5.67 you have some choices:</p>
  <ul>
  <li>Downgrade php to 8.1.24</li>
  <li>Apply the patch at <a href="https://github.com/civicrm/civicrm-core/pull/27981" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/27981</a> but you'll have to manually do it since it won't apply cleanly.</li>
  </ul>
  <p>(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.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-13T10:14:19.063Z
Answers.Text: 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.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-27T22:09:28.147Z
Answers.LastActivityDate: 2023-11-27T22:09:28.147Z
Answers.UserDisplayName: Demerit
Body: <p>On submitted contribution pages, I get a fatal php error &quot;unconstructed IntlDateFormatter.&quot; 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 &quot;unconstructed.&quot;
  I am completely mystified as to what the problem is. I'm hoping someone here has an idea.
  Here is the Apache error log:</p>
  <pre><code>[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-&gt;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-&gt;formatTime()
  #6 /var/www/civi.sitename.org/wordpress/wp-content/plugins/...', referer: https://civi.sitename.org/civicrm/contribute/transact/?_qf_Confirm_display=true&amp;qfKey=CRMContributeControllerContribution187bnnkv5540g8sk0cok0g04owsc8gcosog88k8cs84808w4ok_5444
  </code></pre>
  <p>No entry in the CiviCRM log.</p>
  <p>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.</p>
  <p>I'm running Civi 5.66.1 on WordPress 6.4.1.</p>
  
Tags: <php8>
Title: fatal error "unconstructed IntlDateFormatter" after upgrade to php 8.1
ThreadText: # fatal error "unconstructed IntlDateFormatter" after upgrade to php 8.1
  
  (Asked by: username_0 on 2023-11-27)
  
  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.
  
  **Tags:** php8
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-11-27. Score: 4 | Accepted answer
  
  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:
  
  * Downgrade php to 8.1.24
  * Apply the patch at <https://github.com/civicrm/civicrm-core/pull/27981> but you'll have to manually do it since it won't apply cleanly.
  
  (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.)
  
  > **Comments:**
  > **username_2**: 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.  
  
  ---
  
  