8

Note: I know this looks like a duplicate of this question. I don't see how it is a duplicate. I already stated that I have checked that question, and I tried all the answers, but it didn't work.

Here is what I tried:

  1. Under Dario's answer, I followed the steps but didn't find any php under name section

  2. On the accepted answer I run the same code on command line prompt but it shows:

    appcmd.exe set config /section:handlers "/[name='PHP55_via_FastCGI'].ResponseBufferLimit:0"
    

    and that returns this:

    ERROR ( message:Cannot find requested collection element. )

  3. Then I checked the PHP manual:

    flush manual

    i didn't find anything in that config file like _via_FastCGI

  4. I checked Plesk's PHP setting and yes my server is running on FastCGI mode.

So, I have worked so many hours on my development server for that flush part and now on my live server it is not working. Any help will be highly appreciated

Update 1:

as suggested by @artlung, i have attached the screenshot here:

FAST CGI HANDLERS

Update 2:

Here is what i found in notepad++ by searching with keyword "FastCGI"

<add name="FastCgiModule" lockItem="true" />
<add name="PleskEngine-FastCGI-html" path="*.html" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\admin\bin\php-cgi.exe|-dauto_prepend_file=auth.php" resourceType="Either" responseBufferLimit="0" />
<add name="PleskEngine-FastCGI-html" path="*.html" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\admin\bin\php-cgi.exe|-dauto_prepend_file=auth.php" resourceType="Either" responseBufferLimit="0" />
<add name="PleskEngine-FastCGI-php3" path="*.php3" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\admin\bin\php-cgi.exe|-dauto_prepend_file=auth.php" resourceType="Either" responseBufferLimit="0" />
<add name="PleskEngine-FastCGI-php3" path="*.php3" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\admin\bin\php-cgi.exe|-dauto_prepend_file=auth.php" resourceType="Either" responseBufferLimit="0" />
<add name="PleskEngine-FastCGI-php" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\admin\bin\php-cgi.exe|-dauto_prepend_file=auth.php" resourceType="Either" responseBufferLimit="0" />
<add name="PleskEngine-FastCGI-php" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\admin\bin\php-cgi.exe|-dauto_prepend_file=auth.php" resourceType="Either" responseBufferLimit="0" />
<add name="PHP-phtml" path="*.phtml" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-php3" path="*.php3" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-php" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-phtml" path="*.phtml" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-php3" path="*.php3" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-php" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-phtml" path="*.phtml" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-php3" path="*.php3" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
<add name="PHP-php" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe" resourceType="Either" />
Community
  • 1
  • 1
Zakir_SZH
  • 466
  • 7
  • 21
  • Possible duplicate of [PHP flush stopped flushing in IIS7.5](http://stackoverflow.com/questions/7178514/php-flush-stopped-flushing-in-iis7-5) – Muhammad Shahzad May 19 '16 at 06:51
  • 2
    did you read my post? i told i have check that post and that didn't solve my issue, so i had to post my own :( – Zakir_SZH May 19 '16 at 07:01
  • Is anything here helpful? https://www.iis.net/configreference/system.webserver/fastcgi – artlung May 19 '16 at 15:35
  • 1
    @artlung, thanks for your msg. sir, i have checked that already but there is nothing named "ResponseBufferLimit", but i have take and attached the screenshot with my post. Red marked box seems to be some fact? – Zakir_SZH May 19 '16 at 15:51
  • @Zakir_SZH do you want me to start a bounty to help this post get attention? – artlung May 25 '16 at 13:44
  • @artlung, thanks again for your reply sir, however i am not familar with bounty, but if that helps me in anyway you are very welcome to do that :) – Zakir_SZH May 25 '16 at 14:35
  • @Zakir_SZH I've added a bounty. Good luck. – artlung May 25 '16 at 16:00
  • 4
    How can we recreate this problem so we can help? – Drew May 26 '16 at 17:03
  • My gut instinct when I saw this question was "dammit, not another typo question". Then I actually opened it, read the post, and now all I can think is "I am **so** glad that I don't have to deal with issues like that right now". I don't have an answer (other than the standard "have you tried re{boot|compil|runn}ing"), but I want to wish you the best of luck fixing this. – Nic May 28 '16 at 18:11
  • http://stackoverflow.com/questions/4706525/php-flush-not-working/4978642#4978642 - will this help? – Chetan Ameta May 31 '16 at 04:55

3 Answers3

5

appcmd.exe set config /section:handlers "/[name='NAME'].ResponseBufferLimit:0"

Change NAME to the name of handler you want to update e.g. PHP7_via_FastCGI.

Check the paths, It should solve your issue, I had the same issue and this method helped me.

Gammer
  • 5,453
  • 20
  • 78
  • 121
4

There are many features and their settings that may conflict with each other in IIS.

It seems like you could not be able to set responseBufferLimit for your handler.

You need to know what's your handler's name first.

Open a command prompt and run:

%windir%\system32\inetsrv\appcmd.exe list config -section:system.webServer/handlers | find "FastCGI"

It's possible to have more than one handler listed like below and that's ok. Yours is the top one, in here it's PHP53_via_FastCGI.

<add name="PHP53_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" />
<add name="PHP54_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.4\php-cgi.exe" resourceType="Either" /
<add name="PHP55_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.5\php-cgi.exe" resourceType="Either" />
<add name="PHP56_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.6\php-cgi.exe" resourceType="Either" />
<add name="PHP70_via_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v7.0\php-cgi.exe" resourceType="Either" />

By replacing PHP53_via_FastCGI with yours, run the following command to change the responseBufferLimit:

%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/handlers /[name='PHP53_via_FastCGI'].responseBufferLimit:"0" /commit:apphost

restart the IIS by running:

iisreset

Try the load php page again.

If still not works as expected, you can be sure that it's because of IIS's Dynamic Compression. Since it handles all dynamic responses with content type text/* by default, when it's enabled it could block a PHP response to compress.

You can temporarily disable dynamic compression to see if it works. Take a back up your web site's web.config and put the following instead, and try to load your PHP page.

web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <urlCompression doDynamicCompression="false" />
    </system.webServer>
</configuration>

In case you don't want to disable dynamic compression for all the web site, there are other levels you can disable dynamic compression for virtual applications, physical and virtual directories or a specific file.

For more information have a look at HTTP Compression Feature Requirements

Kul-Tigin
  • 16,728
  • 1
  • 35
  • 64
  • dear sir, when i run the find command for appcmd it does not return anything ;( – Zakir_SZH Jun 02 '16 at 16:58
  • @Zakir_SZH your php handler's name does not contain `FastCGI` apparently. then run the command without `| find "FastCGI"` part and use the top PHP related handler's `name` attribute for the next command. – Kul-Tigin Jun 02 '16 at 17:30
  • @Zakir_SZH remember to run these commands in an **Administrator Elevated** command prompt. – Kul-Tigin Jun 02 '16 at 17:33
  • sir, i did run as administrator but the same thing (output nothing).. however, when i search using note pad++ i have found following matched (added to my question), thanks again for your help – Zakir_SZH Jun 03 '16 at 16:20
1

Look for a fcgiext.ini and uncomment/add the line ResponseBufferLimit=0 to it, then restart IIS.

j4hangir
  • 2,532
  • 1
  • 13
  • 14