Make WordPress Core

Opened 2 years ago

Closed 9 months ago

#54104 closed defect (bug) (worksforme)

Media Library thumbnails broken with PHP 8

Reported by: knieriemrt's profile knieriemrt Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: dev-feedback
Focuses: Cc:


WordPress 5.8.1
PHP 8.0.10
All plugins disabled
Default Theme

I upgraded our PHP to 8.0.10 and WordPress is unable to generate thumbnails for images I upload into the media library. I tried a thumbnail regenerating plugin and that did not work either. I tried PHP 8.0.3 and it didn't work. I dropped the PHP version down to 7.4.11 and it started working again.

I am not the only person with this problem:

Change History (7)

#1 @Hareesh Pillai
2 years ago

  • Keywords dev-feedback added

Hello @knieriemrt, Welcome to WordPress Core Trac.
Thanks for trying out the debug steps and the detailed report.

Just wanted to report that I tried to replicate this in my local install (PHP v 8.0.3), however, I do not face the said issue.

I'm starting to think if this has got something to do with the way the server is set up. I'd wait for other reviewers to share their views.

#2 @knutsp
2 years ago

  • Keywords reporter-feedback added
  • Version 5.8.1 deleted

This is most likely caused by the PHP configuration, like missing recommended extensions. Tools - Site Health - Info - Media handling has more info.

#3 @knieriemrt
2 years ago

  • Severity changed from major to normal

Thanks for the responses. After enabling the GD extensions I am closer. I can upload images but the thumbnails don't work right until I edit the image, then rotate it left then back right and save it. After I do that the image seems fine. Any ideas why the act of uploading doesn't generate the thumbnails but saving from the image editor does?

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

2 years ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

9 months ago

#6 @antpb
9 months ago

Hi @knieriemrt ! There have been a bunch of PHP 8 fixes that have happened over the last year. Are you having these issues still in WordPress 6.2? The release candidate for that version is out and you can install using the Beta Tester Plugin:

If this is no longer valid, just let us know and we can get this closed out. If no response in the next week or so we're going to close this out to keep our backlog true. Thanks!

#7 @knieriemrt
9 months ago

  • Keywords reporter-feedback removed
  • Resolution set to worksforme
  • Status changed from new to closed

Hello @antpb,

I just uploaded an image and the thumbnail worked fine. Somewhere along the way in the last 18 months it was fixed. I am currently running PHP 8.2.1 and WordPress 6.1.1.


Note: See TracTickets for help on using tickets.