PHP的readfile下载大文件时卡住

9050阅读 0评论2016-11-16 lsstarboy
分类:PHP

网上的解决方案很多,但都不是很完美。
其实最重要的是:ob_end_clean()那句,请空缓冲区并且禁用了缓冲区。

  1. @set_time_limit(0);
  2. ini_set('memory_limit', '16M');
  3. ob_end_clean();
  4. @readfile( $path );
以下来自php手册:


  1. This function discards the contents of the topmost output buffer and turns off this output buffering. If you want to further process the buffer




-- end --
上一篇:isc dhcpd 的class定义,以限定某些MAC
下一篇:ffmpeg压缩H264在HTML5播放器下,必须先下载整个文件的解决