Image Upload HTTP error Wordpress

2019-08-29 16:28发布

问题:

When I upload the image in the wordpress,I get the HTTP error.Though images are inserted in upload folder.Yet it shows the error.

I have tried with the .htaccess work .. SecFilterEngine Off SecFilterScanPOST Off .. but didnt work.I also tried with permission for the uploads folder issue. I dont have any error in the debug.log just few of the PHP Notice I have wordpress 3.3,windows with the apache server.

回答1:

Just try to add below code theme’s functions.php file:

add_filter( 'wp_image_editors', 'change_graphic_lib' );
    function change_graphic_lib($array) {
    return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}

for more ways to solve this problem visit this link HOW TO FIX HTTP ERROR WHEN UPLOADING IMAGES



回答2:

Installing the "Default to GD" plugin which "Sets GD as default WP_Image_Editor class."

The plugin is (currently) available here: https://github.com/getsource/default-to-gd/blob/master/default-to-gd.php

It's has function:

<?php
/*
Plugin Name: Default to GD
Plugin URI: http://wordpress.org/extend/plugins/default-to-gd
Description: Sets GD as default WP_Image_Editor class.
Author: Mike Schroder
Version: 1.0
Author URI: http://www.getsource.net/
*/
function ms_image_editor_default_to_gd( $editors ) {
    $gd_editor = 'WP_Image_Editor_GD';
    $editors = array_diff( $editors, array( $gd_editor ) );
    array_unshift( $editors, $gd_editor );
    return $editors;
}
add_filter( 'wp_image_editors', 'ms_image_editor_default_to_gd' );


回答3:

Try to upload the image via File-Zilla or other ftp solutions instead of the build-in utility?

only a suggestion.



回答4:

I ran into the same problem. The problem was with the Wordfence plugin firewall. I turned it to "learning mode" and the upload worked fine.



回答5:

Doesn't work for me. My solution (for CentOS and php in FastCGI mode):

1) Open /etc/httpd/conf.d/fcgid.conf

2) Add or change a values for the following parameters:

FcgidConnectTimeout 20
MaxRequestLen 64000000
FcgidMaxRequestLen 64000000

3) restart apache

apachectl restart


回答6:

I'm using ubuntu and wasn't able to upload images (http error) to a wordpress site in my localhost. In my case I tried uploading to meida via explorer (not drag and drop) I saw that I wasn't able to access that location (in my external hard disk.

So I copied the file to the desktop and was able to load it without any issue.