I'm wondering about the stabillity of PHP when running "endless" looping scripts from the command line?
I'm running RedHat8 with PHP 4.2.2. If I write a script that does some simple job and runs endlessly in a loop, set timeout to 0, and run it into the background at the command prompt like this:
php myscript.php &
how stable should it be? Assume the script does something like a repetative file copy from one directory to another, then sleeps for 2 seconds, then copies it again... and so on.
I know compiling a real program with C++ would be the "right" way to do it, but I already have this script (which is much more complicated than my example, but you get the idea) and I want to just let it run forever. Can I realistically expect this to run for 2 years by itself or should I expect it to crash regularly. What would cause it to crash if it did?
Just curious about how stable this really is. In theory it should be just fine. I've done tests running as long as a week with no problem. Looks "too easy to be true." 😃