I encountered this “There has been an error cropping your image.” error in WordPress when I tried to crop an image for theme header.
The solution is surprisingly easy.
sudo apt-get install php5-gd
This will install the PHP GD library for image processing.
Update: You may need to restart apache server for it to come into effect.
Source: https://wordpress.org/support/topic/image-issues-cropping#post-6230879
14 replies on ““There has been an error cropping your image.” solution”
you also need to restart apache2
Hi David,
Thanks for pointing it out, I’ve updated:)
thanks guy..
but a’m using fedora… wordpress need php-gd for cropping image on wordpress…
for redhat base:
# yum install php-gd
Hi ucup, Thanks for pointing out:)
hi
what I do if I using nginx?
thanks
Hi, for nginx, you’ll likely be running php-fpm.
You should restart the service as such:
sudo service php5-fpm restart
[…] 参考网页:http://yuan3y.com/2014/12/there-has-been-an-error-cropping-your-image-solution/ […]
That worked for me on Ubuntu 14.04!
apt-get update && apt-get -y install php5-gd && service apache2 restart
If you’ra using php-7 try:
sudo apt-get install php7.0-gd
Works for me, thanks 🙂
hello im kind of a noob at this. im getting this error and i have no idea what any of you are talking about or how to change it
the solution applies for those who host their own website on dedicated / cloud server with direct access to shell. If you don’t know about any of these, approach your service provider as you are probably using a shared hosting.
make all (install php7.0-gd, restart apache, clean cache), but this problem is still here 🙁 What else can provide this problem?
It is now 2021, I freshly installed WordPress locally on a Windows 10 PC with one of the newest themes, and I get this same error.
I’m using php 7.4.
The solution appears to be to install or activate php7-gd2 , an extension of php that is not installed by default. (Google knows how.)