wordpress中图像上传的HTTP错误

I am getting HTTP errors on Image upload in wordpress.

To resolve this I tried following steps

  1. I added SetEnv MAGICK_THREAD_LIMIT 1 in .htaccess file. But issue not resolved.

  2. I also added following code in functions.php file. But issue not resolved.

    add_filter( 'wp_image_editors', 'change_graphic_lib' );

    function change_graphic_lib($array) {

    return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    

    }

  3. I also added following code in .httaccess file.

    SecFilterEngine Off

    SecFilterScanPOST Off

  4. I have also used https://github.com/getsource/default-to-gd plugin. But my issue not resolved.

Please help me how can I fix this issue.

Most probably the issue related to server configuration not having the proper amount of memory allocated to Apache/PHP.

If anyone has this same problem, please try verifying that you have enough (64MB+) server memory allocated to Apache/PHP in your server configuration settings. You can also add this to your wp-config.php file: define('WP_MEMORY_LIMIT', '64MB');

mod_security might be causing problems. Disable it to see if that is the problem. To do this, make an .htaccess file in your wp-admin directory. Add this to it:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

If you're using Access Control based on Authentication on your Webserver (often known as htpasswd, Basic Authentiaction, password protected directory or similar), WordPress is not able to handle it for Flash Uploader, Cron and XMLRPC. Related files need to be excluded to work. Keep in mind that this might break your security considerations.

# 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>

One final note: some have said that if using a lesser version of PHP 5.3.X you can try disabling PHP Safe Mode.