As the title describes, I have a shared Web App in Azure with PHP 5.4 as well as the Site Extension PhpManager installed (via Kudu). I have used PhpManager to modify the master php.ini file and variable output_buffering to "Off" from the default 4096.
The setting saves (green tick), and remains if you revisit config, but if you view PHP Info (even after restarting the instance), the output_buffering variable is not respected, it still shows 4096, despite the php.ini file config showing "Off"
I've tried appending to both the .user.ini as well as a custom ini path to have a new line;
output_buffering = Off
This change only results in output_buffering changing to "no value" in PHP Info - but not the desired "Off" result.
Would appreciate any guidance on getting this disabled - I've tried a multitude of ob_flush() flush() ob_start etc to force within the file, with no luck.
As an aside, I created a separate script per below to ensure it wasn't a code issue, and this still outputs in one hit as opposed to progressively as required.
<?php
echo 'Starting...<br/>';
for($i = 0; $i < 5; $i++) {
print "$i<br/>";
flush();
sleep(2);
}
print 'DONE!<br/>';
?>
Cheers,
T
You can custom a handler mapping in web.config
in your root directory(if you don't have one, just create a new web.config
). We can leverage responseBufferLimit="0"
to disable the response buffer in IIS.
Similar with Use a custom PHP runtime on Azure Web App, but we will use the default installed php cgi execute application and we manually create the configuration.
Please try the following content in your web.config
:
<configuration>
<system.webServer>
<handlers>
<add name="PHP-FastCGI"
path="*.php"
verb="GET,HEAD,POST"
modules="FastCgiModule"
scriptProcessor="D:\Program Files (x86)\PHP\v5.4\php-cgi.exe"
resourceType="Either"
requireAccess="Script"
responseBufferLimit="0" />
</handlers>
</system.webServer>
</configuration>