"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." when trying to upload a picture to WordPress.

Fixing issues with uploading pictures to WordPress Media Library

Reading Time: 5 minutes.

This article will go through different solutions for fixing issues with uploading pictures to your WordPress Media Library. There’s plenty of reasons that could cause this issue – and a couple of different ways to bump into it. I’ll be proposing a few different ways to fix the issue in your installation.

Unlike some of the more aggravated users online suggest, this isn’t likely a bug in WordPress – rather, it’s a configuration / compatibility issue. Luckily, it’s usually something you can fix yourself.

Problem

So, once more, the error you see is something like below:

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.

This error might pop up in all of these different situations:

  • Pasting pictures in the WordPress Block Editor (Gutenberg)
  • Uploading pictures to Media Library using the Image -block
  • Uploading pictures to Media Library from the Admin site

The error is not accurate. It’s most likely NOT the server being too busy to serve you (it had one thing to do, right?), and uploading a smaller picture will probably not work at all. IT’s much more likely a problem in the configuration.

Workaround

At least for yours truly, a workaround was to upload pictures one-by-one directly to the Media Library from the Admin site, and refresh the page using F5 every time between uploads.

It’s a crappy workaround, as it only worked about 50% of the time, but it kept the site going before I figured out the actual reason.

Anyway – there are quite a few possible reasons that might cause this issue to pop up. And hence, there are quite a few possible ways to fix it. I’ll try and explain in a simple checklist the things you can change to try and fix this!

Solution

Time needed: 30 minutes.

How to fix “Post-processing of the image failed likely because the server is busy or does not have enough resources.” errors when uploading pictures to WordPress Media Library?

  1. Don’t use weird file names

    Apostrophes, quotation marks, exclamation marks – stuff like that is risky. Try renaming your file to something that only has a-z and numbers – and see if it helps!

  2. Verify your upload limit

    Makes sense to check this next – just open your Media Library and navigate to “Upload Files”. Verify, that the “Maximum upload file size” is something meaningful – e.g., not “1 MB” or something.Upload limit visible on WordPress Media Library's Upload-tab.

    In case you DO have something ridiculously small here, you need to increase the limit to something borderline unreasonable like 128MB.

    There are multiple ways to change this. If you have access to php.ini file, you can configure it right there. If you don’t have access to it (maybe you’re on shared hosting?), you can also edit your .htaccess file to add something like this:
    # BEGIN Increase upload max filesize
    According to this: https://www.cloudways.com/blog/increase-media-file-maximum-upload-size-in-wordpress/
    php_value upload_max_filesize 128M
    php_value post_max_size 128M
    # END

  3. Verify your server resources

    Despite what the error says, this is almost never the reason for the issue. However, it’s simple to verify, so next we’ll take a look at your web hosting plan!

    Navigate to cPanel (or whatever other server/account management software is available to you) and check out the “Statistics” section (or equivalent) to see if the memory usage is anywhere close to maximum.



    In case your server resources seem underutilized, it might be a good idea to enable your WordPress installation to use a bit more of the resources. If you can edit your php.ini file, you can add this to the file:
    memory_limit = 512M

    You can also try and add this to .htaccess:
    # BEGIN Increase memory limit
    php_value memory_limit 512M
    # END


    Or this in your wp-config.php file:
    define( 'WP_MEMORY_LIMIT', '512M' );

  4. Select a supported PHP version

    I’ve read a lot of people complaining about this on PHP 7.3 or PHP 7.4. While it DOES in fact work for me with PHP 7.3, you could try and see if downgrading to PHP 7.2 helps you.

    At the very least this’ll help you narrow the issue down a bit!

  5. Enable required PHP modules

    Verify, that your PHP version has module called “imagick” enabled.

  6. Enable required Apache modules

    I didn’t even have access to this, so couldn’t verify – but I’ve seen a suggestion that an Apache module called mod_fcgid needs to be enabled.

    Didn’t help? Next on to the more exotic issues!

  7. Bypass GD Editor (whatever that even means)

    Some people report adding this to your functions.php helps:

    function use_gd_editor($array) {
    return array( 'WP_Image_Editor_GD', );
    }
    add_filter( 'wp_image_editors', 'use_gd_editor' );

    It didn’t help me, but I thought I’d include it for the odd chance it’d help someone else!

  8. Disable or bypass Cloudflare if you’re using it

    This might be useful just for narrowing the issue down. Clouflare will act as a proxy for your site, so while it might not break anything in itself, it might cause your WordPress installation to misbehave.

    If everything works just fine without Cloudflare, then you know they’re messing with something in your installation.

  9. Disable SecFilterEngine and SecFilterScanPost using .htaccess

    Ah – this is a fun one! My issue (yes – I went through everything above, first) was resolved by disabling mod_security.

    This is a bit unfortunate – but for whatever reason, it seems like it’s messing with Cloudflare (at least with current WordPress version I’m running – 5.4.2). I suggest undoing this hack as soon as possible.

    Anyway – here’s what I had to add to my .htaccess file:

    BEGIN a hack to fix upload errors

    SecFilterEngine Off
    SecFilterScanPOST Off
    END a hack

And that’s about it! Hope it helps.

References

mm
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments