Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:45:24+00:00 2026-05-15T08:45:24+00:00

How do you run a long PHP script and keep sending updates to the

  • 0

How do you run a long PHP script and keep sending updates to the browser via HTTP?

Something to do with output buffering but I don’t know exactly how.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:45:25+00:00Added an answer on May 15, 2026 at 8:45 am

    Output Buffering is thinking in the right direction, you start output buffering with ob_start() just like you would with sessions (session_start) somewhere in the top of your script, before any output is sent.

    Then, you can use ob_flush and flush to keep flushing the output. For example, if you are in a foreach loop and at the end of each loop you want to output the new row and wait 1 second you would can do that.

    But also look at set_time_limit, because otherwise people might experience a timeout after 30 seconds or so.

    Another quick note, some browsers require a minimum number of bytes of output before they actually start showing it. I’m not sure what amound of bytes it was, I think it was around the 4000. Also, some browsers won’t render certain elements (like tables) until they are closed. So flushing won’t work there either.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 511k
  • Answers 511k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer NULL values should be reserved for either: unknown values; or… May 16, 2026 at 5:23 pm
  • Editorial Team
    Editorial Team added an answer From MSDN: "An XPathNavigator object is created from a class… May 16, 2026 at 5:23 pm
  • Editorial Team
    Editorial Team added an answer It looks like all the cases that were causing long… May 16, 2026 at 5:23 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i need to run a really long php script (four and half, five hours).
I want to run a shell script in php, but this shell script takes
I have a long running php script which is basically an infinite loop listening
Just like the the iPhone's app names that run to long, the name gets
My PHP app has an import script that can import records. At the moment,
relatively long-time PHP user here. I could install XAMPP in my sleep at this
I have run in to a slight problem. The story goes as follows: I
Consider a PHP web application whose purpose is to accept user requests to start
I am working on a simplistic website using PHP, a language I haven't touched
I have been able to create php function to determine a list of zip

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.