I have programmed and set up a php web application on a shared Host (using apache server). Before the server being transferred, on each page, header and sidebar and ... was loaded and displayed and each part of the script was displayed immediately after being processed. For example if data was fetched from database and being displayed in a table, after displaying table header, each row was processed and displayed and then the next row and etc. There has been a server transfer and apparently some configurations might have been changed and now each page is only displayed when the whole page is completely processed and is being displayed all at once. I was wondering what the problem might be. Thanks in advance
Asked
Active
Viewed 24 times
1 Answers
0
The issue here is Output Buffering. What happens with Output Buffering is, the output is not sent immediately, but gets sent only after the whole page is processed including delays and sleep.
You can disable output buffering to get the same experience. But beware, you will get the dreadly Headers already sent. errors sometimes.
See How to disable output buffering in PHP to disable output buffering per page or whole.

Community
- 1
- 1

Praveen Kumar Purushothaman
- 164,888
- 24
- 203
- 252
-
Thanks @Praveen Kumar. I thought so, but when i use ob_end_flush() it doesent work! – MehdiK Dec 10 '16 at 11:55
-
@MehdiK Can you altogether remove output buffering? – Praveen Kumar Purushothaman Dec 10 '16 at 11:59
-
unfortunately I'm using a shared host and do not have access to the configuration. – MehdiK Dec 10 '16 at 12:06
-
@MehdiK Page level boss? – Praveen Kumar Purushothaman Dec 10 '16 at 12:07
-
@MehdiK Try adding this to page: `if (ob_get_level()) ob_end_clean();` – Praveen Kumar Purushothaman Dec 10 '16 at 12:08
-
still not working! – MehdiK Dec 10 '16 at 12:27