PHP terminates script unexpectedly -


i'm working in php , creating system lot of php-driven elements , have noticed of pages stop displaying text produced using echo command.

i have made small example of this. of course, program not supposed print allt numbers 1 10000, example demonstrates how script terminates without warnings.

example code:

<?php     ($i = 1; $i <= 10000; $i++) {         echo $i, '<br>';     } ?> 

output:

1
2
more numbers...
8975
8976
8977
8

what causing this? buffer issue, , how resolve it?

the fact code ran completion on cli suggests me script exceeding ini.max_execution_time runtime configuration.

note in linked documentation value of configuration on cli 0 means not time out when run in environment.

the default setting in browser 30 seconds.

you can show current setting in browser with:

echo ini_get('max_execution_time'); 

and should able increase with:

ini_set('max_execution_time', 0); // turns off timeout 

Comments