I have a PHP script that performs some actions in less than 10 minutes (when it doesn't freeze).
The problem is that sometimes, for a reason that I don't know (maybe issues connecting to the remote server) it freezes without any error (cursor blinking like if it was still performing) and it needs to be manually closed and restarted to work again. Many times I only find that it's stuck with some hours delay and that's not good.
I have already tried max_execution_time, but it returns FATAL ERROR which doesn't allow me to restart it and that's not the idea.
Here is the sample code: