Jump to content

500 - Internal Server Error


Rusty3

Recommended Posts

  • 3 weeks later...

You're asking the script to execute infinite times..

 

for ($i = 1; $i <= 100; $i++) {
        echo "$i<br/>\n";
        sleep(1);
}

 

Note you will have to use output buffering and flush() if you wish the echo to actually echo each sleep, and not wait 100 seconds before displaying it all.

Thanks, using flush and changing the php.ini file rather than setting using php seems to have worked... now my problem is the output.... trying everything on php.net/flush

 

You're asking the script to execute infinite times..

 

for ($i = 1; $i <= 100; $i++) {
        echo "$i<br/>\n";
        sleep(1);
}

 

Note you will have to use output buffering and flush() if you wish the echo to actually echo each sleep, and not wait 100 seconds before displaying it all.

if (ob_get_level() == 0) ob_start();//place this at top of page

for ($i = 1; $i <= 100; $i++) {
        echo "$i<br/>\n";
        echo str_pad('',4096)."\n";   

        ob_flush();
        flush();
        sleep(1);
}

ob_end_flush();

 

Try this :P Doesn't require any changing of php.ini settings.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.