Disable output buffering on my local XAMPP server

你。 提交于 2019-12-01 03:44:01

问题


For some reason my XAMPP server is buffering the output of my PHP. I want it to spit it out as it goes. Anyone any ideas which settings I need to change to achieve this?


回答1:


Check out ob_end_flush(), the manual's chapter on output control - specifically the php.ini settings.

Of course if you're just getting a blank page, check your error reporting settings - it's very possible an error halts the script, and with error reporting off you see nothing.




回答2:


XAMPP appears to set output_buffering to 4096 by default. (So content is served in 4K chunks - a possible performance benefit. Although this can lead to unexpected bugs (eg. "headers already sent" etc.) if deploying on a server where this is disabled, which incidentally is the PHP default.)

In php.ini:

; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
output_buffering=4096

Set to:

output_buffering=Off

And restart your server.




回答3:


if you are debugging this in Xdebug and checking the output in the browser there might several reason for that. 1) php 2) apache (web server) 3) Web browser

Read this for the detailed information:

http://muzso.hu/2008/02/19/php-output-buffering



来源:https://stackoverflow.com/questions/2425806/disable-output-buffering-on-my-local-xampp-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!