All Products 
Username / Customer#
Password
Log In
 Hi,  |  Log Out
  • Site Search
  • Domain Search
  • WHOIS Domain Check
24/7 Support: (480) 505-8877
Hablamos Español
9 AM to 9 PM IST
7 days a week
Go Daddy Support

Search help articles, forums, and discussion groups

php flush not working

Viewing post 1 to 12 (12 total posts)
Profile picture of tame4tex

tame4tex said 1 year, 1 month ago:

I have an ultimate shared windows web hosting account.

I am trying to get php flush to work but am having no luck.

Here is the code I am using:

<?php

function flush_buffers(){
ob_end_flush();
ob_flush();
flush();
ob_start();
}

ob_start();
echo(str_repeat(‘ ‘,10000));
echo “starting…
n”;
for($i = 0; $i < 5; $i++) {
flush_buffers();
print “$i
n”;
flush_buffers();
sleep(2);
}

flush_buffers();

print “DONE!
n”;
?>

The browser shows that the page is loading and no output is displayed until the page is fully loaded.

Any advice would be appreciated.

Profile picture of nathantf

GoDaddy Expert nathantf said 1 year, 1 month ago:

@tame4tex

If you are using a Windows hosting plan, that script may not work. There are also browsers that will not display content until it is all available. I would contact our support team to ensure PHP is functioning properly on your account.

Nathan

Profile picture of emmets

emmets said 1 year, 1 month ago:

I have this same issue, and it is new since I moved up to php 5.3.6. For the browser, I use Firefox 11.0 and IE 9.

I have two Linux hosting plans with godaddy. One is on php 5.3.6 and one is on 5.2.14

The below code runs fine on 5.2.17. The number prints every half second until the script finishes. On the newer hosting plan which I’ve configured for 5.3.6, it will not work. It loads for a while, then flushes the entire output at once after the script is done. No intermediate output.

I’ve read a ton of posts about how to do flushing, stuff that must be in php.ini, minimum character outputs, but haven’t been able to solve this. Can anyone help me?

Thanks,
emmets

<?php
$i = 0;
while ($i<=10)
{
echo “i=$i “;
flush();
echo(str_repeat(‘ ‘,1024));
usleep(500000);
$i++;
}
?>

Profile picture of AdamR

GoDaddy Expert adamr said 1 year ago:

@tame4tex @emmets

You should have no problem using PHP flush in our Legacy hosting environment. I will be reviewing the compatibility of PHP flush in the 4GH hosting environment with our hosting guys. I will post an update here as soon as possible.

-Adam

Profile picture of AdamR

GoDaddy Expert adamr said 1 year ago:

@adamr

At this time, PHP flush is not supported in the 4GH shared hosting environment. PHP flush is currently only compatible with our Legacy Linux hosting plans and our virtual dedicated/dedicated Linux server options. If any information about supporting this feature in the 4GH environment comes to light in the future, I will post an update here.

-Adam

Profile picture of assasite

assasite said 5 months ago:

I have experienced the same problem on my site (web hosting – linux/apache). It works on another site I support, but not on GoDaddy.

The program I used to test this is:

<?php
ob_start();
for ($i = 1; $i < 21; $i++) {
echo “$i – string 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890
“;
ob_flush();
flush();
sleep(1);
}
?>

On my other site, it starts to display the results after about 3 seconds and then displays a new line every second. On GoDaddy it waits 15 seconds and then displays everything at once.

I would like to make this work as it significantly improves the feel of response time as some output is displayed immediately.

Profile picture of AdamR

GoDaddy Expert adamr said 5 months ago:

@assasite

For PHP flush support, you’ll need to move to a Legacy plan or a VPS plan. Here’s a link to each of the plans:

Legacy Hosting Plans

https://www.godaddy.com/hosting/hosting.aspx

Moving from 4GH to a Compatible Hosting Plan

VPS Plans

http://www.godaddy.com/hosting/vps-hosting.aspx

-Adam

Profile picture of assasite

assasite said 5 months ago:

Thank you for the prompt response. I believe I am already on a Legacy Plan. The account details page says “Hosting – Web – Deluxe – Linux – US”.

I can see that output buffering works as the ob_get_level and ob_get_length commands show the output buffers changing in my programs.

Rick

Profile picture of AdamR

GoDaddy Expert adamr said 5 months ago:

@assasite

Our ‘Web’ hosting plans are hosted in the 4GH grid environment. This plan will not support PHP flush. At this time, I still do not have any information regarding the future offering of PHP flush support in the 4GH/grid environment.

-Adam

Profile picture of Shrimpwagon

shrimpwagon said 4 months, 1 week ago:

So… does any of the PHP output buffering work? Nothing is working for me

ob_start()
ob_flush()
ob_clean()

Profile picture of assasite

assasite said 4 months, 1 week ago:

I found that it does not work on the hosting plan I am using (Web – Deluxe – Linux).

Rick

Profile picture of AdamR

GoDaddy Expert adamr said 4 months ago:

@shrimpwagon

You would need to move to a Legacy hosting plan. It will not work in our Web/Grid/4GH environment.

-Adam

Add a reply:

You will auto join this group when you reply to this topic.

When posting about a technical issue, please be sure to include as many details as possible, such as your domain name, related URLs and other pertinent information. This consideration will allow us to better understand the situation and quickly assist you.