1

i have this php script:

<?php
set_time_limit(100); // set the maximum execution time to 60 seconds
while (1>0){
echo 'Script execution completed.';
sleep(10); }
?>

it executes perfectly on terminal but doesn't even load on firefox what to do ?

i've set the max_execution_time in php.ini to 100, it didn't help

  • This is probably an output buffer issue. Outputing 10 of those lines doesn't start to fill the buffer so it shouldn't output anything until the end of the script, after 100 seconds. Does it output anything then? Did you wait that long? – KIKO Software Mar 26 '23 at 23:15
  • @KIKOSoftware I've waited, it doesn't output anything – nour el'houda ziane Mar 27 '23 at 00:05
  • OK, try to [switch on error reporting](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display). You should get a time-out message after 100 seconds. Next step is to loop 9 times, instead of infinite, less than the time-out, and see if you get any normal output then. Finally echo much more to fill up the buffer so you get some output on each loop. I believe the standard output buffer is 4096 bytes big. – KIKO Software Mar 27 '23 at 00:18
  • Thank you i tried what you suggested and it worked. – nour el'houda ziane Apr 01 '23 at 16:37

0 Answers0