Updating a progress bar during php scripts

This means you will have to call both to flush the ob output buffers if you are using those.Several servers, especially on Win32, will still buffer the output from your script until it terminates before transmitting the results to the browser.I even tried throttling my loops to see if it was processor related but still had problems.

I would advice using str_pad($text,4096); since this automatically lenghtens the text with spaces to 4 KB which is the minimum limit when using Fire Fox and linux. For a Windows system using IIS, the Response Buffer Limit takes precedence over PHP's output_buffering settings.

You can also turn the compression off for a directory by making a .htaccess file and adding the following entry:mod_gzip_on Off However that affects the whole directory. I just had some problems with flush() and ob_flush().

What I did to resolve this problem took me some time to figure out so I'd like to share what I came up with.

You can set the appropriate line to: Response Buffer Limit=0For IIS 7 , the settings are stored in %windir%\System32\inetsrv\config.

Edit the application Host.config file and search for PHP_via_Fast CGI (assuming that you have installed PHP as a Fast CGI module, as per the installation instructions, with the name PHP_via_Fast CGI).

Updating a progress bar during php scripts