Title: HTTP error when uploading files
Last modified: August 31, 2016

---

# HTTP error when uploading files

 *  [Eric A. Silva](https://wordpress.org/support/users/ericsil24/)
 * (@ericsil24)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/)
 * When uploading images I get an “HTTP error.” We’re on WP 4.5.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Radu](https://wordpress.org/support/users/broseph/)
 * (@broseph)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/#post-7310708)
 * Hello!
 * Here are 7 different solutions that could fix the issue:
 * 1. Make sure you don’t add very large images.
 * 2. If this happens after installing a new plugin, deactivate it and try again.
 * 3. Increase your PHP memory: Add this code: `define('WP_MEMORY_LIMIT', '64M')`
   into your _wp-config.php_ file. If you aren’t familiar with this at all, please
   ask someone for help, don’t do it yourself. Also, some hosting companies don’t
   allow you to increase this value, so check with them first, so you know if the
   change will take place or not.
 * 4. Add one of these codes in .htaccess:
 *     ```
       <IfModule mod_security.c>
       SecFilterEngine Off
       SecFilterScanPOST Off
       </IfModule>
       ```
   
 * or
 *     ```
       # Exclude the file upload and WP CRON scripts from authentication
       <FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
       Satisfy Any
       Order allow,deny
       Allow from all
       Deny from none
       </FilesMatch>
       ```
   
 * or
 * `AddType x-mapp-php5 .php` (at the very top of your .htaccess file)
 * Again, if you’re not familiar with this, ask for help, or you might damage your
   site if it’s not done properly.
 * 5. Make sure the hosting company uses PHP 5.2.4+.
 * 6. Make sure you don’t have an apostrophe in the file’s name (e.g. john**‘**s-
   dog.jpg).
 * 7. If you’re using an image optimization plugin, especially EWWW Optimizer, disable
   the optimization on upload feature, or deactivate the plugin completely, and 
   try again.
 * If you have an image optimization plugin, I’d start with that.
 * You don’t have to implement all these fixes at the same time; one of them should
   do the trick, so try them one by one in whatever way you want.
 * If nothing helps, I suggest contacting your hosting company.
 *  [kleisie](https://wordpress.org/support/users/kleisie/)
 * (@kleisie)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/#post-7310715)
 * Hello Blad
    I tried your suggestions: #3 after that the blog was unaccessable#
   4 didn’t solve it (I tried the first code)
 *  [Radu](https://wordpress.org/support/users/broseph/)
 * (@broseph)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/#post-7310720)
 * Hello!
 * #3 Means you need to talk to your hosting company.
    #4 Tried the others too? 
   But be cautious. Always have a backup.
 *  [Howard Elston](https://wordpress.org/support/users/howard-elston/)
 * (@howard-elston)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/#post-7310800)
 * Thanks for the suggestions.
 * I checked that none of my plug-ins were causing the problem. They weren’t.
 * When I compared the images that were being uploaded with the ones that weren’t,
   I found the only significant difference was file size. After I resized the photographs
   from around 1.5MB to less than 0.5MB, all worked fine.
 * I haven’t had to resize photos before but this has done the trick.
 *  [kleisie](https://wordpress.org/support/users/kleisie/)
 * (@kleisie)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/#post-7310858)
 * Thanks Blade
    Meanwhile my hosting company moved the site to a newer server (
   or at least they said they would do so, but never actually comfirmed this) and
   all seems to be working fine now.
 *  [hmclean](https://wordpress.org/support/users/hmclean/)
 * (@hmclean)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/#post-7310891)
 * WP 4.5 introduced some issues with uploading images. Many people are experiencing
   problems. There is an extensive thread here with several workarounds: [https://wordpress.org/support/topic/http-error-when-uploading-images-17/](https://wordpress.org/support/topic/http-error-when-uploading-images-17/)
 * There are two distinct workarounds that many have had success with. I tried the
   htaccess method and it solved the problem for me.
 * 1) Add this to your .htaccess file at the root of your WordPress installation
   just before the `# BEGIN WordPress` line:
 * SetEnv MAGICK_THREAD_LIMIT 1
 * OR
 * 2) add this to your themes functions.php file (**actually add to a child theme
   functions.php file or use a plugin like[Code Snippets](https://wordpress.org/plugins/code-snippets/)**)
 *     ```
       add_filter( 'wp_image_editors', 'change_graphic_lib' );
   
       function change_graphic_lib($array) {
       return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
       }
       ```
   
 * Alternatively, you may install this plugin instead to change the default image
   editor:
    [default-to-gd](https://github.com/getsource/default-to-gd)
 * If neither of these works for you, try reading the thread mentioned at the top
   to see what others have done.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘HTTP error when uploading files’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 5 participants
 * Last reply from: [hmclean](https://wordpress.org/support/users/hmclean/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/http-error-when-uploading-files/#post-7310891)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
