I've noticed several articles about how to deal with the HTTP error when uploading images to the WP Media library:
How to Fix HTTP Error When Uploading Images?
However, I've already tried adding this code to the 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' );
}
(As was suggested by the most upvoted answer in that article)
And I've also tried some of the things that were suggested in the accepted answer of that article, such as adding define('WP_MEMORY_LIMIT', '256MB');
to the wp-config.php
file, and adding the following codes to the .htaccess
file:
AddType x-mapp-php5 .php
<IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>
# 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>
But still the HTTP error remains.
I admit - I haven't yet tried the suggestions in this article (25 Image Media Uploader Problems – WordPress), but before I do, I also heard that I should try resetting the ownership and permissions of the wp-content folder. And I would like to try that first.
So, what does it mean to reset the ownership and permissions of this folder? Would I simply need to follow the instructions in this article (How to Fix File and Folder Permissions Error in WordPress)?
The article suggests changing the folder permissions to 755 (my folders already have this permission)
And the file permissions to 644.
But I'm nervous about doing this. I don't want to make any changes that can't be undone and I'm not even sure if this is what's meant by resetting ownership and permissions of the wp-content
folder.
Please advise as to whether or not this is the best way of "resetting the ownership and permissions of the wp-content folder", and if you think it will help to eliminate the HTTP error when uploading images to the WordPress media library.
Thanks.
EDIT: Screenshots of HTTP error:
EDIT 2: I have noticed that images with smaller file sizes are able to upload without error. I.e. an image of 578 KB will upload but an image of 610 KB or above will not.
EDIT 3: Setting the permissions of the folders in the root directory to 755
and the permissions of the files in the root folder to 644
as is suggested in the article How to Fix File and Folder Permissions Error in WordPress did not work. The HTTP error when uploading files remains:
I also tried calling my hosting company, and they upgraded PHP to version 7.1 for this website, but the error still remains.