This article applies to servers running Apache with CloudLinux.
While running any website such as WordPress that takes advantage of server applications such as 'ImageMagick' you may occasionally have an environment where you'll receive an error upon uploading images.
As such, when you attempt to upload an image you'll be met with the following error message:
libgomp: Thread creation failed: Resource temporarily unavailable --OR-- Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help
These particular errors are a result of environment setups regarding ImageMagick and its processing on the server that your website is hosted on. Any software application that uses ImageMagick, especially WordPress can experience this error when there is a limited number of resources that account utilizes in comparison to the overall server.
For example, websites hosted in CloudLinux environments can be especially sure to experience this error due to limitations imposed by CloudLinux to ensure ample resources for the rest of the server.
This error can be corrected by specifying a .htaccess rule within your .htaccess file. This rule will specific set the limit for your website to utilize a specific thread count for when processing/utilizing ImageMagick.
For how to access .htaccess for editing, you can see: Accessing .htaccess
The following rule would need to be set within the .htaccess file for the affected website:
SetEnv MAGICK_THREAD_LIMIT 1
Once set, your application/software should be able to upload and/or utilize ImageMagick as necessary for image related requirements.
Ex: WordPress should no longer generate any errors when uploading/processing images.