Jump to content

How do you keep an AJAX connection live?


pentan

Recommended Posts

I'm using AJAX to feed data to a PHP program and that program has to do a fair bit of processing if the data stream is large.  The connection seems to be timing out if I send large chuncks.  How can I force the connection to remain open until the PHP program finishes executing the process?  The process can take as long as two minutes.

Thanks,
Michael
Link to comment
Share on other sites

I'd agree that this is a PHP timeout.  You could try setting the timeout in the php.ini file if you have access to it or you could set it through code using set_ini().

Alternatively, you could split the work up and send it to the server in chunks.
Link to comment
Share on other sites

Yes, you probably need to adjust php's time out limit.

But, if your asking: how do I halt the browser untill the process is complete, use a [u]synchronous[/u] request. Not recommended BTW.

But what in heavens sake are you doing that takes up to two minutes? That's madness.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.