HTTP error while image upload in WordPress step by step : Solved

Are you trying to resolve HTTP error while image upload in WordPress on your WordPress after updating it to Version 4.7.2 ?

Well! i had the same problem in this website, After searching on the different websites i found many solutions for this,  I’ve increased upload max file size on my server, I’ve disabled all my plugins, changed my WordPress theme but i was still getting the HTTP error while image upload in WordPress. Every Different method work for different persons, Okay let’s start.

HTTP error while image upload in WordPress step by step

Http error while uploading image on WordPress

Screenshot Credit :- webgranth.com

Step 1 : If you are uploading  a image larger then 500 x 500 pixels try to reduse it’s size to below 500 x 500 and it will start working 🙂 but If you are not comfortable with this and want to upload a larger image e.g. 1024 x 1024 or still HTTP error while image upload in WordPress like me. Then you must try the next steps.

Step 2 :  Go to the root folder of your WordPress site and find .htacess file and then add below code one by on into  your file.

  • Add this code at the top of your file
 SetEnv MAGICK_THREAD_LIMIT 1 
  • If didn’t worked add this code : 
 AddType x-mapp-php5 .php
  • If above code didn’t wored then add this code:

 <IfModule mod_security.c>
 SecFilterEngine Off
 SecFilterScanPOST Off
 </IfModule>
 
  • Here is another code if all of above didn’t worked:

 

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>

According to my survey these codes worked for many people but it was my bad luck as it didn’t worked for me So i go to the next step.

Step 3 : Download a copy of php.ini file from your hosting's root folder for backup, if there is no such file you can create a new php.ini file. after downloading the copy edit your php.ini file and add the below code.
 
 file_uploads = On
 post_max_size = 100M

max_execution_time 300

max_input_time 300
 upload_max_filesize = 100M

Step 4 : Go to Appearance, click on Editor and scroll down to function.php, and Put below code into the last line of the file.


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

Step 5 : Go to your wp-config.php file and add this line:

define(‘WP_MEMORY_LIMIT’, ’64MB’);
If didn't worked then add below code:

php_value upload_max_filesize 64M
 php_value post_max_size 64M
 php_value max_execution_time 300
 php_value max_input_time 300

But it was my bad luck it didn’t worked for me as well and i was still HTTP error while image upload in WordPress. So i searched again and found next solution which worked for many peoples.

Step 6 : Last step didn’t worked ?? then install the plugin Default to GD. You can download this plugin from here.
Step 7 : 
Go to /wp-content/directory and you will see /uploads/ folder. Right click on the uploads directory and give file permission 755

But in my case the permission was already 755 bad luck huh, now go to the next step.

Recomended : Read another article of our lifehacks author about how to stop breastfeeding

Step 8 : Finally My hosting provider solved my issue regarding HTTP error while image upload in WordPress.

After getting frustrated from all over steps i just contacted with my hosting provider hostingraja and told them to check that if there is any restriction on my server from their side, You know what?? I got a reply from them and they just resolved my issue from their side :). I just tried to ask them that what was the expect issue in my site but they refused to tell me that so that i just logged in my server and typed history and found some of their commands listed below i just tried to look at their changes on codes but didn’t found anything.

/etc/init.d/httpd restart
 vim /etc/php56/php.ini
 /etc/init.d/httpd restart
 vim /etc/httpd/conf.d/mod_security.conf
 find ./ -name “fcgid.conf”
 find . -iname fcgid.conf
 cd /etc/httpd/conf.d/

here is the inside codes of these files If you can crack that what changes they have made please comment below.

mod_security.conf       php.ini

As per my survey i have found that other above methods have also worked for many people.

If all of above methods don’t work for you then you can try to contact your hosting provider as well.

HTTP error while image upload in WordPress : Resolved

HTTP error while image upload in WordPress : Resolved

Please comment below the method which worked for you from given methods above or start a discussion in our forum.

🙂 🙂

28 Comments

  1. Mark Howells-Mead February 14, 2017
    • Nitin February 14, 2017
      • Mark Howells-Mead February 14, 2017
        • Nitin February 14, 2017
        • Nitin February 14, 2017
  2. Neal February 14, 2017
    • Nitin February 15, 2017
    • Mark Howells-Mead February 15, 2017
  3. Mandy February 14, 2017
    • Nitin February 15, 2017
  4. MakeOnlineShop February 15, 2017
  5. Emil February 15, 2017
    • Nitin February 15, 2017
  6. Andrew Wilkerson February 20, 2017
    • Nitin February 20, 2017
      • Andrew Wilkerson March 7, 2017
        • Nitin March 7, 2017
  7. Rahul March 6, 2017
  8. Amita March 24, 2017
    • Nitin March 24, 2017
  9. Amita March 24, 2017
  10. Sudamar January 13, 2018
  11. FS January 24, 2018

Leave a Reply