Is there any problem if i use <?php sleep(60); ?> in my script for 30 times, so that the script will load and finish its works in 30 minutes, is there chance of any problem?
Note: if it fails , is there any way to do like this?
Is there any problem if i use <?php sleep(60); ?> in my script for
Share
The client is likely to stop listening for a response, but it is still possible for the script to complete execution. You would have to configure your PHP installation for long execution times though.
If you are using a browser and AJAX requesting data that will be returned after 30 minutes, it is better to poll a static resource.
When you want to start the script, send an AJAX request to it. This request will eventually time out. Set up your script so that it saves its output to a static resource when it is done (text file / image / etc; depends on what your script is supposed to return). Poll this resource every five minutes using AJAX, and you will get the response from the server when it is ready.