Bug #71420 [Nab]: Can't echo very large strings
| From: | rasmus@php.net | Date: | Thu, 21 Jan 2016 05:50:05 +0000 |
| Subject: | Bug #71420 [Nab]: Can't echo very large strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-198818@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71420&edit=1
ID: 71420
Updated by: rasmus@php.net
Reported by: mark at interactivedimension dot com
Summary: Can't echo very large strings
Status: Not a bug
Type: Bug
Package: Performance problem
Operating System: Linux
PHP Version: 5.6.17
Block user comment: N
Private report: N
New Comment:
Right, but you are getting into technical support questions here and this is a bug tracker. PHP
doesn't do the actual network communications. Your web server and operating system does that.
There is nothing here that indicates a PHP bug of any kind.
Previous Comments:
------------------------------------------------------------------------
[2016-01-20 23:20:44] mark at interactivedimension dot com
I'm not sure. I can do pretty much anything with the string except echo it. I can write it to a
file for instance, but I can't use readfile() and output it on screen, it's really weird.
Although I can do all this on my local machine with no errors.
I've read elsewhere that it may have something to do with Nagles Algorithm and tcp/ip
buffering, but that's a bit over my head.
I've been through all the settings on the server that I can think of but nothing is fixing it.
------------------------------------------------------------------------
[2016-01-20 23:00:19] rasmus@php.net
This doesn't seem like a PHP problem then. PHP has no idea, and doesn't in any way care
what kind of client is used for the request. If one works and another doesn't, the problem is
elsewhere.
------------------------------------------------------------------------
[2016-01-20 21:36:32] mark at interactivedimension dot com
2 million. And the page hangs, never completes. Bizarrely if I view the same page, using the same
wifi connection on a mobile it loads in under a second.
------------------------------------------------------------------------
[2016-01-20 18:34:46] requinix@php.net
To be clear: you're saying the page *hangs*, meaning it never completes? Or it completes but
leaves an empty page? And is that number near 2 million or 2 *billion*?
What about
<?php
error_reporting(-1);
ini_set('display_errors', true);
echo "start<br>\n"; flush();
$data = '';
for($i = 0; $i < 3000000; $i++) {
$data .= 1;
}
echo "end<br>\n"; flush();
echo $data; flush();
?>
------------------------------------------------------------------------
[2016-01-20 16:10:43] mark at interactivedimension dot com
Nothing at all. I don't get any errors on screen either.
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=71420
--
Edit this bug report at https://bugs.php.net/bug.php?id=71420&edit=1