Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pantheon Recipe limits Imagemagick & blocks PDF thumbnail generation for Wordpress. #184

Open
macronomicus opened this issue Jul 4, 2023 · 2 comments

Comments

@macronomicus
Copy link

macronomicus commented Jul 4, 2023

It took me a while to figure out what the culprit was borking PDF thumbnails on Pantheon recipe,
eventually I figured out I could run the following
wp media regenerate --debug
Which gave me some good errors & lead me to discover an olde security recommendation thats no longer needed when you have the latest Ghostscript, which the pantheon recipe & containers do already have. So it can be safely changed, now my site is functioning properly on the local pantheon build, but I suspect I might have to change things up on the pantheon server side too when I cross that bridge, these are their containers we're using in Lando right? It should be nearly identical to production environment?

To resolve I did the following, in case its useful to anyone finding this googling.
lando ssh --service appserver --user root --command "apt-get update && apt install nano -y"

then log in as root
lando ssh --service appserver --user root
cd ..
cd etc/ImageMagick-6
nano policy.xml
CHANGE none TO read
old...
<policy domain="coder" rights="none" pattern="PDF" />
new...
<policy domain="coder" rights="read" pattern="PDF" />

Anyhow, it was such a weird one I just thought itd be useful here, nothing much comes up in context when googling the problem, so at least its here now, & perhaps it can be fixed upstream in the pantheon containers, or a better fix than I found is figured out.

@macronomicus
Copy link
Author

I checked, it is doing the same thing on the production side up on pantheon, so its just the default state for latest wordpress sites then. So, I need find if there's a place I can add this requirement, maybe in the pantheon.yml or something nice and convenient like that would be nice perhaps, as I dont wish to create a custom upstream for such a tiny change.

Im surprised there's nothing on google about it, but I guess needing to use the inbuilt wordpress feature for pdf thumbnails isnt that popular lol.

@macronomicus
Copy link
Author

macronomicus commented Jul 5, 2023

Updating the site to use PHP 8.2 via pantheon.yml cleared things up for me since the needed change was made in that build, just had to lando rebuild afterwards & it fetched the updated appserver into my local lando dev.

I guess that explains why I found nobody complaining in google lol, I had made the sandbox site for this 2 years ago but just working on it now, so I guess it still had older php even though I did upstream updates. Ooof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant