HTTP Error while uploading media on wordpress

This post shows to how to solve http error while uploading media files on wordpress dashboard.

Fix 1

Try changing PHP versions if the multiple PHP versions are supported on control panel .

Fix 2

Most common issues for the newer wordpress versions is the issue with ImageMagick. ImageMagick is the default Image Editor for wordpress. Try changing it to GD libraries. This will resolve the issue. For that, we can make use of a plugin “default-to-gd”. This is available on https://github.com/getsource/default-to-gd/blob/master/default-to-gd.php as code. We need to copy down 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. Open the WordPress dashbard >> plugins, you will see it installed. Activate the plugin. This will enable GD as default image editor for wordpress.

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

This fixes HTTP Error while uploading media on wordpress.

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.