[wp-trac] [WordPress Trac] #61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call

WordPress Trac noreply at wordpress.org
Fri Oct 11 11:41:44 UTC 2024


#61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call
-----------------------------+---------------------
 Reporter:  verygoode        |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  6.7
Component:  Upgrade/Install  |     Version:  2.8
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+---------------------

Comment (by da5f656f):

 Replying to [comment:10 lifelightweb]:
 > Is there a work-around I can employ to get past this?

 I have the same configuration as you, PHP 8.1, latest WordPress. Running
 on Amazon Linux 2 and auto updates disabled.

 This seems to happen to me:
 1. Plugin updates fine, no issues. This seems to happen with plugins with
 small numbers of files.
 2. Or, plugin updates correctly (success message), but refreshing the
 plugin page shows the plugin completely gone or deactivated
 3. Or, when upgrading the plugin I will get a variety of error messages:
 Destination folder already exists, Failed to copy file

 My solution so far is:
 1. Before upgrading make sure your screenshot your plugins list, some will
 literally disappear
 2. Try upgrade
 3. If fail, try “add new plugin” screen from Plugins page
 4. If fail, try a few times to do this. Sometimes it seems to work on the
 second or third
 5. If that’s not working, rename folder in plugin directory using file
 manager or FTP or SSH. Try adding plugin again

 I have been able to update all my plugins with these steps, but it’s been
 a challenge. Specifically big plugins (many files) like Yoast or W3 Cache
 have caused more issues.

 I thought it was the Jetpack Protect plugin that caused this issue, but I
 think it’s more likely this core WordPress issue above.

 It seems to happen sometimes - not always. For me, this has only seemed to
 affect an old old site I manage (but fully updated and on PHP 8.1)

 I have run Wordfence premium scans and no issues. Site health is great.

 I know this all sounds crazy. I’ve managed and developed on WordPress for
 8 years and haven’t had plugin issues like this.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61114#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list