Bug #71420 [Opn->Nab]: Can't echo very large strings

From: Date: Wed, 20 Jan 2016 23:00:24 +0000
Subject: Bug #71420 [Opn->Nab]: Can't echo very large strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198812@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: Open +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: 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. Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2016-01-20 15:33:35] rasmus@php.net Anything in your error log? You could be hitting a configured memory limit. ------------------------------------------------------------------------ [2016-01-20 14:12:44] mark at interactivedimension dot com Description: ------------ Hi I'm not sure if this is a php bug or some kind of server config. The script below will not run on my shared server at all. It will however work on my local machine. It will output a string of up to approx 2million characters but there comes a point where the page just hangs and never loads. I can't figure out a way around this. I've tried breaking the string into smaller parts but I can only output so much before the same thing happens. Test script: --------------- <?php $data = ''; for($i = 0; $i < 3000000; $i++) { $data .= 1; } echo $data; ?> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71420&edit=1

« previous php.bugs (#198812) next »