By newserverguy
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!
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:
ls -al
… and that should give you the user and group that owns the files. If it’s root or another user, you can run:
chown -R www-data:www-data /path/to/root
… and that’ll change permissions to www-data, thus allowing PHP to read and write to files.
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.