I have a particular PHP web page that can take over an hour to process.
When visitors come to this page, I want the code to redirect them to a
separate page at my site. After the redirection, I want the PHP script
to continue operating on its own until the process is complete.
I am attempting to implement this is by sending a "Location" header to
the client. This header is sent out near the top of the script. After
sending the header, I call Flush(), then the script continues into the
heavy lifting. Finally, the script quietly terminates with an exit call.
Neither the flush() or ob_flush() calls are working (I even tried
calling them both). Regardless of what I do, the server will not send
the "Location" header until the script has completely terminated. It
appears that my hosting provider has Flush() disabled.
I have thought about using Chron to accomplish this. However, the
smallest Chron resolution is minutes. This could cause the visitor to
wait for up to a minute before Chron wakes up and starts working on the
process.
There has got to be a better way. Does anybody have any
recommendations?
Thanks,
Ron