Read files in chunks to avoid memory limits when download_via_php is enabled. Fixes #2334.
Added support for X-Sendfile and X-Accel-Redirect headers for file downloads via PHP.