[jQuery] Re: JQuery and AJAX Heartbeat question

2010-01-19 Thread mind01
Thanks for your tips brian and scott.

 set_time_limit(0);

 The expected value is integer seconds. A value of 0 disables the time
 limit altogether.

If i try set_time_limit(20); it gives me an 500 error after 20
seconds, but if i set the value to 60 seconds, i still get a server
time out after 30 seconds.

I have seen upload scripts with some kind of callback to the server to
avoid a time out.
There must be something i can do right?

Thnx again.


[jQuery] Re: JQuery and AJAX Heartbeat question

2010-01-19 Thread Scott Sauyet
On Jan 19, 4:44 am, mind01 mindproduction...@gmail.com wrote:
 If i try set_time_limit(20); it gives me an 500 error after 20
 seconds, but if i set the value to 60 seconds, i still get a server
 time out after 30 seconds.

If you're in control of the php.ini file, there is almost certainly a
setting in there you can use.  But I doubt this is something
overridable in individual scripts.

 I have seen upload scripts with some kind of callback to the server to
 avoid a time out.

Yes, but uploads are handled differently than these scripts.  I'm
pretty sure your PHP script is not called until the entire HTTP
request is received.  Callbacks are probably built with something
watching for the upload to a file to be completed, although that's a
complete guess.

 There must be something i can do right?

Well you, of course.  If you can update the php.ini, I'm sure you can
fix this.  But that would mean that your server might hang, for say
ten minutes on other requests that are not processing, just stuck.

I think the solution I suggested before would not be terribly
difficult to work out.

Good luck,

  -- Scott


Re: [jQuery] Re: JQuery and AJAX Heartbeat question

2010-01-19 Thread brian
Whoops. I guess this bit of info from the manual is pertinent:

Warning

This function has no effect when PHP is running in safe mode. There is
no workaround other than turning off safe mode or changing the time
limit in the php.ini.


On Tue, Jan 19, 2010 at 4:44 AM, mind01 mindproduction...@gmail.com wrote:
 Thanks for your tips brian and scott.

 set_time_limit(0);

 The expected value is integer seconds. A value of 0 disables the time
 limit altogether.

 If i try set_time_limit(20); it gives me an 500 error after 20
 seconds, but if i set the value to 60 seconds, i still get a server
 time out after 30 seconds.

 I have seen upload scripts with some kind of callback to the server to
 avoid a time out.
 There must be something i can do right?

 Thnx again.



[jQuery] Re: JQuery and AJAX Heartbeat question

2010-01-18 Thread Scott Sauyet
On Jan 18, 4:25 pm, mind01 mindproduction...@gmail.com wrote:
 I have a PHP script called zip.php to generate a zip file. This
 requires more than 30 seconds so my server give me an server error 500
 time-out. Can i avoid this 500 error with JQuery and AJAX heartbeat?

Probably not.  AJAX is just going to give you additional HTTP
requests, and won't change what's happening on the server for the
initial request.

One possibility would be to have your script start a process that will
do the zipping and then use AJAX to poll from the client to see if the
zipping is complete.  Once it's finished, you can download it or do
whatever else you need.  The process you start would probably have to
be a bit more complicated than just zip.  You might want to start
something that zips to a temporary file and when that's complete
renames it to the file name you'll be polling for.  Otherwise, PHP
might tell you that the file is ready even though its still being
built.

Good luck,

  -- Scott