Site Loader

You may get the following error message when you try to upload a bigger image to Media Library in WordPress:

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

And you might find some solutions on Google which indicate that it’s a problem with the large image processor added to WordPress 5.3, and many articles say you can add this line to the functions.php file to disable it:

add_filter( 'big_image_size_threshold', '__return_false' );

Or to tell you to install the Disable BIG Image Threshold plugin:

Disable "BIG Image" Threshold

All of the above methods are solving the problem by configuring WordPress itself. However, if you self-host your WordPress site with Nginx, the error message persists even if you modify the big image settings in WordPress. This is because the HTTP server also returns an HTTP 413 Request Entity Too Large error when the uploaded image exceeds the maximum threshold of Nginx settings.

Post-processing of the image failed likely because the server is busy or does not have enough resources

You can modify the maximum allowed client body size in nginx.conf:

# set client body size to 10M #
client_max_body_size 10M;

You can also modify the related settings in php.ini:

;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 64M
;The maximum size of an uploaded file.
upload_max_filesize = 10M
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 12M

Do not forget to reload/restart the service:

$ sudo service nginx reload
$ sudo service php-fpm restart

 

如果您覺得這篇文章有幫助,歡迎點幾下下方的 Like 鍵支持,謝謝!
If you find this article useful, please help by pressing the Like Button below, thank you!

Post Author: starshine

2 Replies to “Fix Image Upload Error in WordPress”

  1. Hey There. I discovered your blog the use of msn. That is a really smartly written article.
    I will be sure to bookmark it and return to learn extra of your useful information.
    Thanks for the post. I will definitely comeback.

Leave a Reply

Your email address will not be published. Required fields are marked *