I created a script that receives data from some web services and our database, formats the report, then encrypts it and makes it available for download. When I first started, I made a script command line command to see the result when it came out, and bypass the script timeout limit that you get when viewing in a browser. But since I do not want my user to use it from the command line or have to run php on his computer, I want to make this start from our web server.
Since this script may take several minutes to run, I need a way to allow it to be processed in the background, and then start downloading after the file is successfully created. What is the best way to let this script run without starting a timeout? I tried to do this before (using the reverse steps to run the script separately and so on), but gave up, so I ask here. Ideally, the user clicks the submit button on the form to launch the request, and then returns to the page instead of forcing them to look in an empty browser window. When the zip file exists (which means the process is complete), it should notify them (via the reloaded AJAX page? I don’t know yet).
This is on a Windows 2007 server.
Chris source
share