admin管理员组

文章数量:1122832

I have installed all the required extensions like ImageMagick, Imagick, and Ghostscript. I used a plugin to test the requirements and everything passed.

ImageMagick:     Installed
Imagick:     Installed
Ghostscript:     Installed
WordPress >= 4.7:    Installed

GPL Ghostscript 9.27 (2019-04-04)

But for some reason, WordPress does not generate thumbnails for PDF files while uploading them directly from the media manager or from the post editor. I also tried using the Regenerate Thumbnails plugin but it did not scan for the PDF file.

I have hosted my website on the Plesk server. Is there anything that I might be missing?

I have installed all the required extensions like ImageMagick, Imagick, and Ghostscript. I used a plugin to test the requirements and everything passed.

ImageMagick:     Installed
Imagick:     Installed
Ghostscript:     Installed
WordPress >= 4.7:    Installed

GPL Ghostscript 9.27 (2019-04-04)

But for some reason, WordPress does not generate thumbnails for PDF files while uploading them directly from the media manager or from the post editor. I also tried using the Regenerate Thumbnails plugin but it did not scan for the PDF file.

I have hosted my website on the Plesk server. Is there anything that I might be missing?

Share Improve this question asked Feb 26, 2022 at 17:18 Dev GuyDev Guy 1411 gold badge1 silver badge2 bronze badges 3
  • … did you find a solution to this? I have something similar (in terms of effect) going on. – omega33 Commented Aug 29, 2022 at 2:19
  • I had to reinstall the Apache Extensions and restart the web server. – Dev Guy Commented Oct 20, 2022 at 15:04
  • Possible duplicate of wordpress.stackexchange.com/questions/391803/… There are several possible causes though. – Cedric Knight Commented Jun 20, 2024 at 15:46
Add a comment  | 

1 Answer 1

Reset to default 1

Rather than the Regenerate Thumbnails plugin, which from versions 3.1.3 to 3.1.6 is skipping PDFs, you can try the WP CLI command

wp media regenerate <id> <id> <id>

(I've seen examples of using seq and xargs to regenerate a range of attachments, which works.)

Among other things, if a library is not installed or configured to not allow PDFs, this will give a more informative error message than the silent failures you may get from uploading, or using the Regenerate Thumbnails plugin. In particular, I was seeing

attempt to perform an operation not allowed by the security policy 'PDF' @ error/constitute.c/IsCoderAuthorized/426

Fixes for this are described at https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion . In short, edit /etc/ImageMagick-6/policy.xml to remove the policies under disable ghostscript format types`, then restart PHP-FPM or the web server. PDFs thumbnails should then be created.

本文标签: Thumbnails not being generated for PDF files