I am running Linux CentOS 5.8 and I have my web pages using WordPress 4.0.

I am trying to uplad jpg photos to server via WordPress, but it randomly fails. I uploaded few photos, and then I get errors like:

“4.JPG” has failed to upload due to an error
The uploaded file was only partially uploaded.

Then I try again and again and again until it is successfuly uploaded. Very frustrating.

How can I debug this? Is there a log file? Where to look for?

  • 1
    Can you add more info on what webserver this is running on? Does this only happen with big files?
    – kraftner
    Jan 29, 2015 at 14:07
  • 1
    Files are only 100 kB. Webserver is Apache.
    – Danijel
    Jan 29, 2015 at 14:18
  • 1
    Same problem here. Apache/Debian.
    – Jo Smo
    Nov 10, 2016 at 20:25

5 Answers 5


I solved it by adding

<?php header ("Connection: close"); ?> 

in file.php situated under wp-admin/include

  • Never ever edit core files and BTW how does it solve the issue.
    – bravokeyl
    Nov 14, 2016 at 5:30
  • Yes it worked perfectly ! Nov 14, 2016 at 5:33
  • Yes worked, but how? Feb 19, 2018 at 7:48

Look at replay by Roberto:


RequestReadTimeout handshake=0 header=20-600,MinRate=500 body=20,MinRate=500

By default Apache will stop upload after 20-30 seconds. With this directive placed into Apache config upload will continue up to 600 seconds as long as user is sending at least 500 bytes/s.


I ran into the same problem and tried doing a google search and came up with so many technical suggestions that I could not begin to even start as I'm not tech savvy. I did run into an article where a blogger said she contacted her hosting server and they changed the PHP version. It may or may not work for me but I was going to try.

Only I didn't know how to do that and I just got off with customer support and basically what he did was increase my bandwidth. I still couldn't upload. I did tell him in the add media library page it did say max upload file size was 2MB. But it wasn't until I refresh the page that the change kicked in and I saw my maximum upload file size was 256 MB. After that I was able to upload photos just fine!


I managed to resolve this problem with changing Apache server configuration: there is a KeepAlive flag which needs to be turned Off.

More about this flag:

Apache Optimization: KeepAlive On or Off?


I solved this, by removing libapache2-mod-php5filter:

apt-get remove libapache2-mod-php5filter

and installing libapache2-mod-php5:

apt-get install libapache2-mod-php5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.