[SOLVED] HTTP Error while uploading media in WordPress

Hello Friends,

Today I will show you how to completely resolve the HTTP Error while uploading media in WordPress.

In my previous post, I have already updated the one reason for this error. Reference: [FIXED] HTTP Error while uploading media in WordPress

In the above URL, I have explained that if you have network connectivity issue, you will face HTTP error. However If you do not have network connectivity issue, then how to resolve this.

Here I will show the complete fix for this. If you follow this, you will not face any issue regarding HTTP error.

 

Fix 1:

Change the below PHP parameters for your site for which you are facing issue.

    max_execution_time 300
    max_input_vars 5000
    memory_limit 368M
    post_max_size 128M
    upload_max_filesize 128M

 

Now try uploading the media for your site from WordPress to see if the issue persist. I believe that you will not face the issue any more. However if this does not resolve the issue, you can go for Fix 2 given below.

 

Fix 2:

You can try using the plugin : default-to-gd. This is available on https://github.com/getsource/default-to-gd/blob/master/default-to-gd.php as code. You need to copy that code into wp-contents/plugins >> create a new directory “default-to-gd”, inside that create a new php file “default-to-gd.php” with following code :

 

 <?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’ );

 

Save the file. Now open the WordPress dashboard >> plugins, you will see it is installed. Activate the plugin. This will enable GD as default image editor for wordpress.

Try uploading an image on media >> upload new , It will work like a charm.

Please let me know if you still have any issue.

Thank you.

My name is Shashank Shekhar. I am a Software Engineer, currently working in one of the leading web-hosting companies in India. I am having 2 years of experience in Linux Server Administration.

I love to work in Linux environment & love learning new things.

Powered by Facebook Comments

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.