Sorry for resurrecting this old thread, but I'm having a somewhat similar issue. I have this php script that uses curl to open several http pages, so it takes a long time to run... sometimes it may take 2 hours to complete.
It was designed to be a background task, so no screen output, and...