I'm trying to write a long executing code, but it hangs after a set amount of seconds, and I want avoid this using any workaround.
The workflow:
User send an AJAX request on the press of a button. This initates a process (function), which for example polls multiple websites for info or sends POST data using cUrl. Ideally, it should provide some info once in a while, but it would be even better if it would run in the background.
The no-no's:
The following functions cannot be used in the code: set_time_limit, exec, fork, anything pcntl related.
Possible solution:
I searched through many posts, and one possible workaround would be to split the code to multiple parts (ex. send one cUrl at a time) and have have jQuery reinitiate the connection until a given condition.
But is there a way on the server side to avoid timeout? I also tried using the Process component of Symfony, Ratchet, sockets...
Many thanks!
Edit: Fixed formatting. I forgot to mention that the code has to be reusable on any server, so editing any config files is not an option either.