我正在尝试编写一个脚本来读取要下载的文件 . 这个脚本适用于我用过的其他所有PHP服务器 . 但我收到以下错误:

(In Firefox) The connection was reset. The connection to the server was 
             reset while the page was loading.

(In Chrome) No data received. Unable to load the webpage because the 
            server sent no data

当我检查文件是否存在时,它 does

//This prints "1"
echo file_exists( "my.pdf" );

但是当我尝试读出文件时,我得到了错误 .

<?php
//If I remove these headers it is able to print the file data to the web page
header( "Pragma: public" );
header( "Expires: 0" );
header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
header( "Cache-Control: private", false );
header( "Content-Type: application/pdf" );
header( "Content-Disposition: attachment; filename=\"my.pdf\";" );
header( "Content-Transfer-Encoding: binary" );
header( "Content-Length: ". filesize( "my.pdf" ) );

//If I take out this line, it works!
if ( file_exists( "my.pdf" ) ) readfile( "my.pdf" );
?>

可能有什么不对?

SETUP

The File Size :500K

OS: Windows Server 2008 R2企业版Service Pack 1

PHP: PHP版本5.4.7

Modules: 芯mod_win32 mpm_winnt http_core mod_so mod_access_compat mod_actions mod_alias中mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_file模块mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi一样mod_dav_lock的mod_dir mod_env mod_headers中mod_include负责mod_info mod_isapi mod_log_config mod_cache_disk mod_mime mod_negotiation模块的mod_proxy的mod_proxy_ajp mod_rewrite的mod_setenvif mod_ssl的mod_status的mod_php5

upload_max_size: 2M(这比我试图阅读的文件大)

cURL Largefile: 是的

EDIT

这是 Headers (打印到页面以显示其值):

Pragma: public
Expires: 0
Cache-Control: must-revalidate, post-check=0, pre-check=0
Cache-Control: private
Content-Type: application/pdf
Content-Disposition: attachment; filename="my.pdf";
Content-Transfer-Encoding: binary
Content-Length: 489936