Apache won't serve images larger than ~2K

Solution 1:

A few things you can try:

  • Try setting EnableSendfile off in the Apache config and restart (see Apache core documentation). Also try EnableMMAP off (see here for a issue very similar to yours).
  • When testing with a browser make sure the cache is cleared and/or force the image to be reloaded.
  • Test with a variety of file sizes and types. Is it just PNG files, all images, etc...? Narrowing in on what image size works and what doesn't might help in the end.
  • Try testing another web server (lighttpd, nginx, ...) and see if they exhibit the same behavior. This should tell you if the issue is Apache specific or something on the server/network itself.
  • Download files both remotely and locally and see if the response is any different.

Solution 2:

This issue is not browser based, you'll experience this issue no matter what browser you use. The file is corrupt because it isn't downloading completely. You can verify this by downloading it via scp or ftp transfer (which you should do to verify that it is in fact not corrupt).

Try a wget for the specific file. This will allow you to focus directly on downloading the file rather than dealing with any php or html issues that may have cropped up.

 wget http://your.website.com/path/to/image.png

Also, attempt this with a gif and jpg file so that you can be sure that maybe it's not just something with png and the upgrade.

Something else to look at would be to tail your logs:

 # tail -f /path/to/apache/logs

That way you can have a second terminal open and watch the results in real time as you attempt to access the images.

If you don't get anywhere with that (or hopefully you track the issue down to apache rather then with the images) uninstall and then reinstall apache.