#19886 [Fbk]: readfile, fread, fpassthru won't work with large files!!!
| From: | wez@php.net | Date: | Mon, 14 Oct 2002 00:06:50 +0000 |
| Subject: | #19886 [Fbk]: readfile, fread, fpassthru won't work with large files!!! | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-22329@lists.php.net to get a copy of this message | ||
ID: 19886
Updated by: wez@php.net
Reported By: spic@php.net
Status: Feedback
Bug Type: Filesystem function related
Operating System: Windows, any Version
PHP Version: 4CVS-2002-10-13
New Comment:
I just fixed (I hope) a socket-shutdown bug (#16114).
The interesting thing is that this is only to do with
writes to sockets opened by streams (so it should not
affect PHP output).
It might be that the Microweb server also has a similar
bug, or that it has some other threading issue.
It doesn't make sense for this to be related solely to
streams, as they aren't time-dependent, and they are
certainly not dependent on other PHP processes.
Can you try reproducing the problem using Apache, PWS
or IIS?
Can anyone reproduce this on another platform?
Previous Comments:
------------------------------------------------------------------------
[2002-10-13 17:21:54] sniper@php.net
Did this work in any previous versions of PHP?
Is it stricly win32 thing? Does this workin in e.g. Linux?
------------------------------------------------------------------------
[2002-10-13 10:40:41] nicos@php.net
May be its because that the stream hasn't enough time to get its new
position. I didn't read streams.c/h well enough too.
------------------------------------------------------------------------
[2002-10-13 10:30:31] spic@php.net
In addition
[frame1.php]
<?
// Adding sleep(5) will solve the problem the first time a
// >100k File is called. The next output of a >100k File
// will crash again...
sleep(5);
header("Content-type: application/pdf\n");
readfile("some_100k_large.pdf");
?>
------------------------------------------------------------------------
[2002-10-13 10:22:32] nicos@php.net
That last comment should let us open it back.
Removing the "big-files-passthrough" let the scripts run properly.
@Wez: can you check it? may be its because of the position of the
stream at the end of the execution of the first checksize?
------------------------------------------------------------------------
[2002-10-13 10:19:11] spic@php.net
The following snippets illustrate the environment
[frameset.php]
->frame1.php
->frame2.php
->frame3.php
[frame1.php]
<?
header("Content-type: application/pdf\n");
readfile("some_100k_large.pdf");
?>
[frame2.php]
<?
echo "Something";
?>
[frame3.php]
<?
echo "else";
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/19886
--
Edit this bug report at http://bugs.php.net/?id=19886&edit=1