|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73069 readfile() mangles files larger than 2G
Submitted: 2016-09-13 06:48 UTC Modified: 2016-10-18 11:51 UTC
From: ellinger at six dot de Assigned: laruence (profile)
Status: Closed Package: Streams related
PHP Version: 5.6.26RC1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ellinger at six dot de
New email:
PHP Version: OS:


 [2016-09-13 06:48 UTC] ellinger at six dot de
See bug #72505 posted for Version 7.0. This seems to be still an issue in the 5.6 branch. Readfile simply starts all over again at the 2GB border, i. e. repeating Bytes 0 + x, resulting in corrupted output.

Requesting a cherry pick. :-)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-13 13:52 UTC]
-Assigned To: +Assigned To: laruence
 [2016-09-13 13:52 UTC]
@laruence Has there be a particular reason that bug #72505 had
been fixed for PHP 7.0+ only?
 [2016-09-15 00:30 UTC]
We support reading large file by chunk, but
2GB or more string support is only in PHP 7.0+, isn't it?
 [2016-09-15 00:44 UTC]
Disregard previous comment. readfile() only read file and output directly. IIRC, it uses mmap() with fixed buffer size. It could be extended probably.
 [2016-10-18 11:51 UTC]
-Status: Assigned +Status: Closed
 [2016-10-18 11:51 UTC]
Done at ac07008bb7eeee46c9e45c976fc3dc264f0eadff (part of 5.6.27)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 09:01:28 2024 UTC