|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-01-20 14:12 UTC] 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;
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
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(); ?>