IIS 7 and Above
Buffer flushing (in php) doesn't work
Last post Aug 16, 2011 04:15 PM by sergejack
Aug 16, 2011 09:27 AM|Sergejack|LINK
I use IIS 7 (+Administration pack) with PHP installed as FastCGI.
When I try to flush (ob_flush()) my webpage in php, it doesn't do anything, the page isn't loaded until the very end of the process.
What should I do? (I read a few posts but I didn't find any clear enough answers)
fastcgi php buffer
Aug 16, 2011 12:10 PM|HCamper|LINK
Are you using Windows 2008 or Vista ?
Have you check IIS Net Library guides
for settings for Recycle and FastCGI ?
Are you using Wincache Extension ?
The answers from Forum Threads may not be correct (clear)
unless more is known about the IIS Server or Windows.
Have you tested with test.php <?php phpinfo(); ?> and it works ?
Does the PHP engine function at the command prompt for test.php ?
Does a simple test.php work it could be you have extension problems in the php.ini.
If the you do a test.php is it blank you may have incorrect Time / Zone settings ?
Aug 16, 2011 01:20 PM|Sergejack|LINK
Thanks for the interrest you take in mt question.
It's running on Vista (x86).
It's an install I made today with the default configuration.
I used the PHP auto installer (for FastCGI) which does a great job (I never had problem with it) and sets the maxrequest related variables just right.
I'm not familliar with wincache extension, what about it?
PHP + FastCGI work (I tried phpinfo() as soon as the installation was done) and my page eventually renders (as a whole).
When using the command prompt, the page flushes progressively as I expect it to.
I read, one couldn't use flush/buffer + FastCGI but those were old posts and with no or few credits given.
So I'm not confident that affirmation is accurate/correct.
Aug 16, 2011 01:55 PM|HCamper|LINK
I suggest you check this
there are a number of post install steps for a "Default" configuration.
You say the test.php eventually renders you should check the php_error.log
you may have errors. The "Default" configuration is set to not display errors so you need to do the post install
You should check that IIS Server has the correct "Handler and Mapping settings for Machine
and "Default" Web Site. After you did the PHP install and made IIS Server changes did you restart the IIS Server ?
After everything is working check
http://www.iis.net/download/WinCacheForPhp Wincache Extension
download and information.
Aug 16, 2011 03:09 PM|Sergejack|LINK
I set the errors to be displayed.
And there areno error in my script.
I tried calling the webpage using telenet and I got the same result: the response hangs until the whole page is sent to the client.
I don't get what you're willing me to double check. Could you be more specific about what you think could be wrong in my settings, please?
Aug 16, 2011 03:36 PM|HCamper|LINK
The most comon problems are in php.ini file for extensions.
Example from IIS Net PHP Community Forum and this
and the user had extension and Time / Zone problems.
What does the php_error.log show for errors or messages ?
Have you looked at php.ini and changed any settings ?
Calling the page test page via telnet maybe slow.
Did you test using IIS Server by putting test.php at C:\Inetpub\wwwroot\test.php .
Then browse to http:// localhost / test.php ?
You can post the php_error.log or php.ini settings.
Aug 16, 2011 04:15 PM|Sergejack|LINK
I found a workarround.
Everytime I want to flush the buffer, I have to call in order: