[Resolved] After upgrade to PHP 8.3 from 7.4 we cannot login
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're upgrading your site to PHP 8.3 from PHP 7.4 and encounter a login loop when WPML Multilingual CMS and Share Buttons by AddThis plugins are both activated, this might be due to a conflict between these plugins under PHP 8.3. This issue results in an inline JavaScript block within WPML's script growing uncontrollably, causing the site to run out of memory. Solution: We recommend deactivating the Share Buttons by AddThis plugin or replacing it with another plugin that is compatible with WPML. You can find a list of WPML-compatible plugins here.
If this solution does not resolve your issue or seems outdated, please check for related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket here.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to update our site to PHP 8.3 from 7.4. However, when we do this and attempt to log in, we encounter a loop on the login screen. Our hosting company and we are quite technical, and we have identified that the issue occurs when three WPML plugins are enabled. The problem does not occur on PHP 7.4. This issue is similar to a problem described here: https://wpml.org/forums/topic/fatal-error-after-php-upgrade/. We also experience this behavior on a staging site from eqs. The issue can be seen at: hidden link
Symptoms:
When attempting to log in after upgrading to PHP 8.3, I get a loop on the login screen and nothing happens. This does not occur on PHP 7.4.
Questions:
Why does enabling WPML plugins cause a login loop on PHP 8.3?
How can we resolve the login loop issue when using PHP 8.3 with WPML plugins?
I ran some tests and enabled script debugging on the local copy of your website. Here's what I found: I switched to a default theme and left only WPML Multilingual CMS and Share Buttons by AddThis activated. Both must be active for the issue to happen with PHP 8.3. If either one is deactivated, the website works again.
The issue is likely being caused by a conflict between WPML Multilingual CMS and the Share Buttons by AddThis plugin when using PHP 8.3. When both are active, WPML's script (sitepress-scripts) adds an inline JavaScript block that grows uncontrollably, repeating the same line thousands of times. This leads to the site running out of memory and crashing.
This problem does not happen with PHP 7.4, and it’s likely due to how PHP 8.3 handles memory and script processing.
The easy fix here, is to remove the AddThis plugin, or replace it with a WPML compatible one. If there is one that does the same job, you can find here: https://wpml.org/plugin/