|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79423 copy command is limited to size of file it can copy
Submitted: 2020-03-27 21:01 UTC Modified: 2020-03-29 12:53 UTC
From: jeff at forerunnertv dot com Assigned: cmb (profile)
Status: Closed Package: Filesystem function related
PHP Version: 7.3.16 OS: windows
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: jeff at forerunnertv dot com
New email:
PHP Version: OS:


 [2020-03-27 21:01 UTC] jeff at forerunnertv dot com
From manual page:

I am pretty sure there is some kind of limit to the size of file that the copy command can actually copy on Windows 10.

For example if I try to copy a 5GB+ file, it will return as succesful, but will not actually copy the whole file.

Could this limitation be confirmed and added to the documentation?



Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-28 22:44 UTC]
-Status: Open +Status: Feedback -Type: Documentation Problem +Type: Bug -Package: Unknown/Other Function +Package: Filesystem function related
 [2020-03-28 22:44 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2020-03-28 23:19 UTC] jeff at forerunnertv dot com
-Status: Feedback +Status: Open
 [2020-03-28 23:19 UTC] jeff at forerunnertv dot com
  $from = "C:\myBigFile.mp4"; // Needs to be a big ile, like 5GB or 6GB
  $to = "C:\myBigFile_COPY.mp4";
  copy($from, $to);
 [2020-03-28 23:43 UTC]
-Status: Open +Status: Verified
 [2020-03-28 23:43 UTC]
Copies exactly 1GB. Affects other functions like stream_copy_to_stream() as well.

There may be an existing bug report for this problem.
 [2020-03-29 12:53 UTC]
-Assigned To: +Assigned To: cmb
 [2020-03-29 12:53 UTC]
This is a Windows only issue, and is because we're not properly
retrieving the file size when mmapping.  After this is fixed, on
32bit systems files up to 4294967295 bytes can be copied; 64bit
systems practically have no limit.
 [2020-03-29 13:07 UTC]
The following pull request has been associated:

Patch Name: Fix #79423: copy command is limited to size of file it can copy
On GitHub:
 [2020-09-22 11:20 UTC]
Automatic comment on behalf of
Log: Fix #79423: copy command is limited to size of file it can copy
 [2020-09-22 11:20 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 23:01:29 2024 UTC