When I try to crop an image in the WordPress backend area of my custom theme, I get the message "There has been an error cropping your image". I have it set up on a local machine using XAMPP. When I set up the exact same theme on a server, it works perfectly fine.
I checked quite some questions that seemed to be similar to my problem, but nothing worked so far.
I disabled all plugins. I checked the php.ini for extension=php_gd2.dll
, which is not uncommented. I don't know what else could be the problem.
Interestingly when I change the theme to "Twenty Eleven" cropping images works.
When I try to crop an image in the WordPress backend area of my custom theme, I get the message "There has been an error cropping your image". I have it set up on a local machine using XAMPP. When I set up the exact same theme on a server, it works perfectly fine.
I checked quite some questions that seemed to be similar to my problem, but nothing worked so far.
I disabled all plugins. I checked the php.ini for extension=php_gd2.dll
, which is not uncommented. I don't know what else could be the problem.
Interestingly when I change the theme to "Twenty Eleven" cropping images works.
Share Improve this question asked Aug 24, 2017 at 17:43 TheKidsWantDjentTheKidsWantDjent 3154 silver badges19 bronze badges 2- Your theme might be forcing WordPress to use a specific image library to crop the images which is not supported, you might want to look that one up. – Johansson Commented Aug 24, 2017 at 17:46
- In addition to the Jack Johansson comment, possible your theme tries to write to not writable folder. And on the server this folder is writable for some reason – Anton Lukin Commented Aug 24, 2017 at 17:50
2 Answers
Reset to default 3For the record since I ended up here when experiencing the same issue on my localhost:
- In php.ini, Uncomment the line with: extension=php_gd2.dll
- Restart apache / all services
This sorted it out for me (I may have switched a few other services on while I was there, but I believe this is what fixed it!)
Facing same problem while learning the wordpress with localhost but the above 2 soltions are the exact which i tried and problem solved: locate c/xampp/php/php.ini open file in any editor locate for: ;extension=gd ;extension=php_gd2.dll remove ';' semicolon to uncomment and save the php.ini file restart the apache and you are done !