Issue
This is more a question about nohup than my PHP script although I will include code for you guys to see. I am using a script what is designed to never end, meaning script termination should never take place. In an ideal world the script would run forever. This is achieved with <?php while (true) {} ?>
which I am led to believe is the correct way of doing this?
However I am finding my script is terminating for reasons unknown every few days. The longest the script has run for is 4 days. I am left baffled and unable to reproduce test case scenarios without the aid of having the output from the process at the time of termination. Does nohup allow you to see what happens when the process terminates?
I can see the process running when I do ps aux and once the script has finished execution it disappears from the ps aux list, suggesting that the problem is with the she'll environment the script is run in rather than any portion of my code?
Can anybody help. Any debugging tools for this would be appreciated.
EDIT: I am looking for tools to debug this scenario any help appreciated.
Solution
The problem here was with MySQL. MySQL needed to be configured not to die after a long session. (or re-establish periodically)
Use show variables like 'wait_timeout';
to see what your setup is configured for.
Answered By - youdsmedia Answer Checked By - Marilyn (WPSolving Volunteer)