Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP error when uploading an image via the WordPress Media Uploader

Each time I try to upload an image using the WordPress Media Uploader (WP Admin > Media > Add new) the upload stalls at around 13% and I get an error message appear on screen "HTTP error".

So far I have created a php.ini file in my WordPress root with the following:

memory_limit = 256M
upload_max_filesize = 16M
post_max_size = 64M

I've also put a php.ini file in my /wp-admin/ folder (an exact duplicate of the above).

After checking with phpinfo() I can see these changes have taken effect but they have not resolved the 'HTTP error' problem I am getting.

I am using a 1and1.co.uk dedicated server (managed) so don't have root access. 1and1 have confirmed plain CGI is enabled on the server (not Fast CGI if that makes much difference?).

Why might this error be happening? Is there anything else I can do to try to resolve it?

UPDATE: I have done some testing using different browsers and different devices:

Acer Aspire One netbook

  • Chrome - problem exists
  • FireFox - problem exists
  • IE - working
  • Safari - problem exists

Acer Aspire 5552 laptop

  • Chrome - working
  • FireFox - working
  • IE - working
  • Safari - working

Google Nexus 7 tablet

  • Chrome - working
  • FireFox - working
  • IE - working
  • Safari - working

Samsung Galaxy G4 Mini

  • Chrome - working
  • FireFox - working
  • IE - working
  • Safari - working

As you can see the problem only exists in Chrome, FF and Safari on my Acer Aspire One netbook. What could be the source of this problem?

like image 419
henrywright Avatar asked Apr 28 '14 14:04

henrywright


People also ask

Why is WordPress not allowing me to upload images?

The image upload issue in WordPress is typically caused by incorrect file permissions. Your WordPress files are stored on your web hosting server and need specific file and directory permissions to work. Wrong file permissions prevent WordPress from reading or uploading file on the hosting server.

How do you fix an error occurred in the upload Please try again later?

I found a simple solution. If you save the post you are working on as a draft, then attempt the upload again, it works. This appears to happen if you have been drafting a document for a long time, without manually saving. Once you manually save, it resets the upload ability somehow, and the problem goes away.


1 Answers

I put the following code into my functions.php file. It works!

add_filter( 'wp_image_editors', 'change_graphic_lib' );
function change_graphic_lib($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
like image 131
Ganesh Pawar Avatar answered Oct 05 '22 11:10

Ganesh Pawar