Can’t get image editor to work in WordPress Media, only shows this error message “Could not load the preview image. Please reload the page and try again.”
I went to see if I have both gd & imagick installed and enabled
Running both these commands I can see that they are enabled and installed
php -i | grep -i gd
php -i | grep -i magick
and reloading using
sudo service ph7.0-fpm restart
it still doesn’t work. Also enabled debugging/debug log in wp-config.php to see if anything shows up but nothing in the error log.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
From what I can tell, you need to dig into your PHP error logs (might show up in Nginx error logs). This is usually caused by a WP plugin (or theme) that has a space after the code, which results in a “header already sent” error from PHP. Try disabling all your plugins and changing theme to default 2017 and see if that helps. If yes, then active one-by-one.
@greensociety
Have you checked user permissions on your files and directories? By default, PHP-FPM runs as the
www-data
user, so all files and directories would need to be owned by that user in order for PHP to be able to read/write.You can
cd
to your root directory (where./wp-config.php
is) and run:… and that should give you the user and group that owns the files. If it’s
root
or another user, you can run:… and that’ll change permissions to
www-data
, thus allowing PHP to read and write to files.