Viewing 6 replies - 1 through 6 (of 6 total)
  • 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. johns-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.

    Hello Blad
    I tried your suggestions:
    #3 after that the blog was unaccessable
    #4 didn’t solve it (I tried the first code)

    Hello!

    #3 Means you need to talk to your hosting company.
    #4 Tried the others too? But be cautious. Always have a backup.

    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.

    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.

    WP 4.5 introduced some issues with uploading images. Many people are experiencing problems. There is an extensive thread here with several workarounds: https://www.ads-software.com/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 likeCode 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

    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.