'I can't upload image in wordpress

when i upload an image in wordpress media library this message appears

post-processing of the image failed likely because the server is busy or does not have enough resources. uploading a smaller image may help. suggested maximum size is 2500 pixels.

i have tried some methods to solve it like increase Maximum upload file size and change php version

I'm using hostGator as a web host .



Solution 1:[1]

I faced the same issue and in my case it was related to nginx

413 Error response 
Request Entity too large 

and yes image was more than 2M by default in NGinx configuration

client_max_body_size 2M; -> client_max_body_size 64M; should be set in server or location section of .conf file

Wordpress was running in docker compose and that was the root cause

Solution 2:[2]

use wp filter add_filter( 'big_image_size_threshold', '__return_false' );

Solution 3:[3]

If this error occurs on your Local by Flywheel desktop app I was able to fix it by changing the web server from nginx to Apache.

enter image description here

Solution 4:[4]

There are a few solutions to this issue. First, are you running PHP 7.3 and WordPress 5.3? You may try downgrading to PHP 7.2.

Next, you may try increasing your site’s memory limit.

If neither of these works you may attempt to work around it.

  1. Go to your media library and select any picture. Preferably one that you managed to upload successfully. Click Edit and look at where the picture is located. keep this open or remember it.

  2. Connect to your server via an FTP client and navigate to this folder where your images are stored. Upload your large photographs to this folder.

  3. They won’t show up in your media library yet. You need to use a plugin called 'Add From Server'. Download that and install/activate it (by Dion Hulse).

  4. Backup your WordPress installation (just in case).

  5. Finally, hover over Media and then select the new option = Add From Server

  6. Navigate to the folder where you uploaded your photos. Make sure you select just the photos you want to import into your Media Library (although you could delete the duplicates if you make a mistake).

  7. After you click go, it’ll take some time, but don't cancel it or refresh the page. Just wait, and you’ll get a notification on the same screen when it's done. Along with a new list of imported files (including size variations if applicable).

  8. Now your photos will be in your media library with ‘scaled’ at the end. You can now use these in your posts and they will work just fine.

NOTES The files are imported to wherever you select them from. So it’s important that you put them in the same folder as the rest of your active pictures BEFORE you import them. Otherwise, they’ll show up in the media library, but won’t actually work on your website (took a while to figure this out).

I’d recommend importing 10-15 pictures at a time if they are large. Any more and you risk being signed out of your cPanel due to inactivity and it may break your installation (maybe, hence the backup).

Also, you may look through this wordpress.org thread as many solutions are discussed in the thread. https://wordpress.org/support/topic/unable-to-upload-images-67/page/5/

Let me know if this helps!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Denis Rudov
Solution 2 Sabih Ali
Solution 3 nerdess
Solution 4 Kashif