Modsecurity Error When Uploading Something Larger Than 100kb Inginx

How to Ready the WordPress HTTP Fault (Uploading Images to Media Library)

As with any platform, there are always those annoying errors or problems yous have to learn how to piece of work through. Trust the states, we've pretty much seen them all! From the white screen of death to database connection errors, WordPress definitely has its quirks. But we still love it! Today we're going to swoop into one of the more common ones, theHTTP error. Users typically see this when trying to upload images or videos to the WordPress media library.

While the HTTP fault is usually easy to fix it can exist rather frustrating equally information technology usually interrupts your workflow. Zip is worse than spending twenty minutes trying to discover that perfect image for your weblog postal service, y'all go to upload information technology, and bam, yous're of a sudden met with a very vague error.

Beneath we'll explore why this error happens and what you can do to speedily resolve information technology then yous can get dorsum to uploading your media.

What is the WordPress HTTP Error?

The WordPress HTTP fault occurs when something goes wrong while attempting to upload images or videos using the congenital-in media library tool. Unfortunately, unlike browser errors where we can usually reference an HTTP condition code, WordPress errors are sometimes a picayune harder to troubleshoot (especially if y'all don't know how to enable WordPress debugging mode).

The very vague "HTTP error" definitely doesn't aid you determine what might be wrong or even where to starting time looking. But that is because there could be a few causes for the failure and WordPress simply doesn't know why, so it spits out a generic error message (as seen below).

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 WordPress HTTP error when uploading images

How to Fix the WordPress HTTP Error

From our feel, the WordPress HTTP error typically originates from two things: the offset is aclient-side or user error (your login session, bad characters in the file proper noun, etc.), and the second is aproblem or setting on your WordPress host(server upshot, memory list, third-party plugin, shared hosting throttling resources, etc.). So we'll dive into a petty of both.

Here are some recommendations and things to bank check to fix the error (sorted in club by most common reasons we see):

  1. Refresh the Page
  2. Shrink or Resize the File
  3. Rename the Prototype File
  4. Temporarily Conciliate Plugins and Theme
  5. Ask Your WordPress Host
  6. Increase PHP Retention Limit
  7. Check Uploads Folder Permissions
  8. Move to the Latest Version of PHP
  9. Fix Performance Issues with Imagick and Shared Hosts
  10. Remove Custom Media Library Path
  11. Disable mod_security
  12. Install the Add To Server Plugin

1. Refresh the Page

The very first thing you should do when encountering the WordPress HTTP error is to merely refresh the folio in your browser. Sounds too easy correct?  Well, actually this is the nearly common fix we've seen for it. Hither's why:

Start, for whatever reason, your browsermight accept lost connectedness temporarily with WordPress and the process simply failed to complete. This could be due to your ISP, a temporary hiccup with your WordPress host, etc. If y'all refresh the folio and try uploading again information technology the error sometimes will resolve itself.

2d, we've also seen that sometimes after refreshing the page, or coming back to the WordPress editor from another tab, that it all of a sudden kicks you out. This is most likely an indicator that your WordPresslogin session has expired. You should come across the following message:

Your session has expired. Please log in to proceed where you left off.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 Your session has expired

Then naturally, you log back in and attempt to upload your media again. Still, the HTTP error occurs. This is kind of a quirk with WordPress. Once y'all log back in, you lot need to actuallymanually refresh the page you're on. Then uploading media volition work once more.

ii. Shrink or Resize the File

You might need to edit your image file, which could entailreducing the file size(KB or MB) ordecreasing the width/summit (pixels). We recommend checking out our in-depth post on how to optimize images for the spider web. In that location are a lot of third-party paradigm optimization plugins y'all can use to automatically do this for yous (both reducing and resizing) when your paradigm is uploaded to the media library.

We accept usedImagify on our Atakdomain site for years without a single result. But there are a lot of other keen ones out there equally well. Simply make sure whichever plugin you lot use, that they are optimizing images on their own servers, non locally. If yous're majority optimizing images locally this tin drastically damage your site'south performance.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

Imagify WordPress plugin

It's OK to upload high-resolution images asWordPress supports responsive images out of the box. In fact, you will probably desire to and so that the image looks crisp on retina displays. Merely unless your a photographer or business that needs high-resolution images a skillful rule of pollex though is to keep your final paradigm size under 100 KB and no more than double the size of your website's content div width.

Also, you lot might have to play with the PNG and JPG file types. Sometimes one can be much larger than the other depending on what type of image information technology is.

Depending on the configuration of your WordPress host, you might also want to await into increasing the WordPress maximum upload file size.

3. Rename the Paradigm File

It can never hurt to try and rename the paradigm file. WordPress should automatically append a number on the end if yous endeavour to upload a duplicate file name, but in case that doesn't piece of work, try renaming your file. Unfortunately, WordPress doesn't let you rename the file of an already uploaded image file, so you will need to rename it locally and re-upload it.

When nosotros are uploading images that already be nosotros typically add a -1 or -2 on the stop (example: paradigm-file-1.png, epitome-file-two.png). Make sure to add the nuance otherwise Google will read it as ane discussion and it could injure your SEO.

Besides, to be safe, stay clear of uploading an epitome with file names that contain special characters. This includes international language symbols and characters such equally apostrophes. Dashes are OK. You can come across in this case below on the Atakdomain Japanese site, we are using English language for the file names, not the special characters. While WordPress can technically support these, there are a lot of other issues that tin pop up.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 Rename paradigm file with no special characters

iv. Temporarily Deactivate Plugins and Themes

It's always a practiced thought if y'all're having HTTP errors to trydeactivating your plugins and fifty-fifty switch your WordPress theme to the default to come across if this resolves the problem. A few plugins that are are typical culprits include image optimization plugins (they tie direct into the media library) and security plugins such as WordFence (these plugins are sometimes besides restrictive). Or you can simply delete your WordPress theme.

If you lot don't want to affect your live site, simply clone your live site to a staging environment. If the WordPress HTTP error is likewise happening on staging, so you tin speedily deactivate all your plugins to start narrowing it down.

Remember, you won't lose whatsoever data if you simply deactivate a plugin. If you can nevertheless access your admin, a quick way to exercise this is to browse to "Plugins" and select "Deactivate" from the bulk deportment menu. This will disable all of your plugins.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 Deactivate all plugins

If this fixes the issue you'll need to find the culprit. Commencement activating them one by one, and try uploading an image again in the media library. When you see the HTTP error return, y'all've plant the misbehaving plugin. You lot can then accomplish out to the plugin programmer for assistance or post a support ticket in the WordPress repository.

If y'all can't admission WordPress admin you tin can FTP into your server and rename your plugins folder to something similar plugins_old. Then check your site once again. If it works, so yous will need to examination each plugin one past one. Rename your plugin folder dorsum to plugins and then rename each plugin folder inside of if it, one by one, until you notice it. You lot could also effort to replicate this on a staging site first.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 Rename plugin binder

The same goes for your WordPress theme. Typically themes don't necktie into the media library, but we've seen some weird setups. It never hurts to attempt switching your theme over to the default Twenty Seventeen theme to encounter if it fixes it. Just like with plugins, you don't accept to worry about losing your current theme settings. All of that is stored in the WordPress database.

5. Ask Your WordPress Host

If yous've tried the steps to a higher place already and are yet getting the WordPress HTTP error, we recommendreaching out to your WordPress host for aid before proceeding. Many of the additional troubleshooting steps are a little more advanced and a lot of times you can enquire your host to do or cheque on this for you.

Atakdomain's support team is bachelor 24×7 from the lesser correct-hand side of the MyAtakdomain dashboard.

 Atakdomain WordPress hosting back up

half-dozen. Increase PHP Memory Limit

Another cause for the WordPress HTTP error is that yourserver lacks the available retention for the background upload procedure to complete successfully. This is a very common trouble with shared WordPress hosting. To fix it yous demand to increase the amount of retention PHP tin can utilise.256 MB is recommended.

The default memory limit for Atakdomain clients is already set to 256 MB. If you host your WordPress site at Atakdomain you shouldn't have any problems with a lack of retentivity.

Increase PHP Retentivity Limit with wp-config.php

You tin increase the PHP memory limit past calculation the following lawmaking to your wp-config.php file. Note: this may be overwritten by a server-level dominion in identify by your WordPress host.

---

Increase PHP Memory Limit in cPanel

If your host is using cPanel, you tin can increase the PHP memory limit in 2 dissimilar areas.

The starting time is under the software section. Click on "Select PHP Version." Click on "Switch to PHP Options." You tin can so click on "memory_limit" to modify its value.

The 2nd area is besides under the software section. Click on the "MultiPHP INI Editor" tool. This allows you to modify the php.ini file. Simply scroll downward to where it says "memory_limit" and input a higher value.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 Increase PHP memory limit in cPanel

Increase PHP Memory Limit with php.ini

Want to know how nosotros increased our traffic over 1000%?

Join 20,000+ others who get our weekly newsletter with insider WordPress tips!

If yous aren't using cPanel, you tin can also edit the php.ini file direct if you have admission. To practice this, login to your site via FTP or SSH, go to your site'southward root directory and open or create a php.ini file.

Can't connect via SSH? Larn how to ready the SSH "Connection Refused" error.

If the file was already there, search for the "memory_limit" setting and alter information technology as necessary.

Some shared hosts might also crave that y'all add the suPHP directive in your .htaccess file for the above php.ini file settings to work. To do this, edit your .htaccess file, besides located at the root of your site, and add together the following code towards the top of the file:

--

Increase PHP Memory Limit with .htaccess

The .htaccess file is a special subconscious file that contains various settings you lot can use to modify the server behavior, right down to a directory specific level. If you don't accept admission to php.ini, nosotros suggest you try this next. Beginning, login to your site via FTP or SSH, take a wait at your root directory and see if there is a .htaccess file there.

If at that place is you can edit that file to and modify the "php_value memory_limit" value.

7. Cheque Uploads Folder Permissions

Typically when at that place is a folder permissions error you should go a bulletin in WordPress about it non being able to write to the directory. However, this might non always be the example. If a WordPress site has been hacked or infected with malware, in that location could be a lot of issues going on with the permissions.

Tip:Atakdomain offers costless hack fixes for all clients.

The main binder yous're concerned with is your /wp-content/uploads binder, as this is where files are stored when uploaded via the media library.

According to theWordPress Codex, alldirectories should be 755 (drwxr-xr-x) or 750.

You tin can easily see your folder permissions with an FTP client (equally seen beneath). You could also achieve out to your WordPress host back up team and inquire them to quickly GREP file permissions on your folders and files to ensure they're prepare properly.

Make sure that if yous manually update the permissions on this folder that you check both the "Recurse into subdirectories" pick likewise every bit the "Apply to directories but."

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 WordPress uploads directory permissions

8. Move to the Latest Version of PHP

WordPress officiallyrecommends PHP vii.3 or college. If y'all're not running on that, yous're below the minimum requirements fix by the developers of the CMS.

We e'er recommend running the latest and supported versions of PHP due to the fact it offersbetter security and performance, including bug fixes and functions that need to be deprecated.

Nosotros have seen older versions of PHP contribute to all sorts of errors, including the infamous WordPress HTTP error. At Atakdomain you lot tin can easily change to PHP seven.iv with a unmarried click in the MyAtakdomain dashboard.

 Change to PHP 7.four

If your host uses cPanel they might already take an option available to you to alter your version of PHP. Simply log in to cPanel and nether the "Software" category click on "Select PHP Version."

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 Select PHP version

You lot can and so select the PHP versions available to yous that your host supports.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 PHP 7 in cPanel

9. Prepare Performance Issues with Imagick and Shared Hosts

At that place are two dissimilar PHP modules WordPress uses for paradigm processing: GD Library and Imagick (ImageMagick). Depending on what is installed on your server, WordPress may employ either one.

The problem is thatshared WordPress hosts take a lot of hidden resource throttling behind the scenes. That is the merely style they tin cram so many users on the same machine. A common issue people run into is that in that location are too few resources allocated to Imagick (ImageMagick). Hosts will limit the ability to use multiple threads, hence resulting in the WordPress HTTP error.

Y'all can add the post-obit code to the top of your .htaccess file, changing the thread limit value to something higher.

---

Some other option you lot take is to tell WordPress to utilise the GD library instead of Imagick. You can practise this past merely adding the post-obit code to your theme'south functions.php file.

---

We'll be edgeless. If you're having to tweak things like thisit's time to move to a new WordPress host. Atakdomain doesn't have crazy limits similar this in identify and for the about part, you're only limited by PHP workers. You shouldn't have to worry nigh these types of things every bit a website owner.

We employ LXD managed hosts and orchestrated LXC software containers for each site. What this means is that every WordPress site is housed in its own isolated container, which has all of the software resources required to run information technology (Linux, Nginx, PHP, MySQL). The resources are 100% private and arenot shared betwixt anyone else or even your own sites.

Read more than about how Atakdomain is unlike than whatsoever other host yous've tried.

ten. Remove Custom Media Library Path

Information technology very well could be that your media library path isn't setup correctly. We typically see this when users migrate their local development site over to product. If you look in "Media" nether "Settings" in your WordPress dashboard and see a file path value listed, get ahead and delete it and click "Salve Changes." Y'all desire your media to be stored in the default /wp-content/uploads folder.

Below is what it typically looks like. If you don't run into a library path, then y'all're all good here.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 WordPress media settings

eleven. Disable mod_security

Mod_security is an open source firewall that sometimes might cause the WordPress HTTP error to occur. You can disable mod_security by adding the following code to the top of your .htaccess file.

--

If y'all're using cPanel, you tin can likewise disable it by clicking into "ModSecurity" in the "Security" section.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 cPanel ModSecurity

And so toggle the status from "On" to "Off" next to the domain yous want to disable it on.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

 Disable mod_security

We always recommend using an enterprise-grade and yet affordable WAF like Sucuri or Cloudflare instead. Y'all can read our recommendation for the  best WAF settings here.

12. Install the Add From Server Plugin

Concluding merely non least, if you're really in a bind and nil else seems to be working, you can install the gratisAdd From Server plugin. Perhaps you're waiting for a response from your WordPress host or a developer on how to get the WordPress HTTP fault resolved.

How to Fix the WordPress HTTP Error (Uploading Images to Media Library) | Atak Domain Hosting

Add From Server WordPress plugin

The Add to Server plugin will usually get y'all around the mistake and could exist a good temporarily fix, especially if you're right in the middle of something of import. It was originally developed to allow y'all to add very big files via SFTP.Important: this plugin is no longer maintained or supported. Employ at your own risk.

Summary

Every bit yous can see in that location are quite a few different means to fix the WordPress HTTP error. Hopefully one of the solutions higher up worked for you and yous're already dorsum on track and uploading your media. If you lot go along to receive this fault time and fourth dimension again, it might be time to consider upgrading to a better WordPress host. Many of the solutions above are things you don't have to worry about at Atakdomain.

If you found a solution that isn't in our list, please exit a comment a below and we'll get it added.

Salvage time, costs and maximize site functioning with:

  • Instant help from WordPress hosting experts, 24/vii.
  • Cloudflare Enterprise integration.
  • Global audience attain with 29 data centers worldwide.
  • Optimization with our built-in Application Functioning Monitoring.

Buy WordPress Hosting at Best Prices!

fieldsdithery.blogspot.com

Source: https://www.atakdomain.com/en/blog/how-to-fix-the-wordpress-http-error-uploading-images-to-media-library

0 Response to "Modsecurity Error When Uploading Something Larger Than 100kb Inginx"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel