Jump to content

Progress bar for long running scripts


renobird
 Share

Recommended Posts

I need to create a progress bar for a long executing csv export.

I know how to do all the front end stuff, but I'm encountering some issue with polling the progress, and need some assistance.

The hosting environment is preventing me from using the the flush(), ob_flush() process, not sure why.

I have an older script that used to work well, but it doesn't now. It might have something to do with apache settings, but I can't track it down.

I've been attempting to write the progress to a $_SESSION variable, but I can't seem to get around session locking, so when I try to check the $_SESSION variable via ajax, I get nothing because the script has the session locked until it's done. 

I can't use web sockets because I need support IE9.

I haven't tried writing the progress to a temp file.

What are some other options? 

Suggestions welcome.  :)

Link to comment
Share on other sites

Doh!

Somewhere in the back of my mind, I remembered solving this issue with session locking before.

session_write_close() is what I needed.

I'll post back here with a full solution to keep the topic relevant.

  • Like 6
Link to comment
Share on other sites

  • 1 year later...
On 28/05/2015 at 3:32 AM, renobird said:

The hosting environment is preventing me from using the the flush(), ob_flush() process, not sure why.

 

On 28/05/2015 at 4:09 AM, renobird said:

I'll post back here with a full solution to keep the topic relevant.

Hello,

I'm facing this issue at the moment... A PHP script that seems to take too long and the browser returns a timeout. Flushing works fine on my localhost but doesn't on remote :(

I have no idea what I can do, so if @renobird or anybody else has some advice, I would appreciate :)

Thanks !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...