How to interrupt function execution after X seconds?
| From: | helices | Date: | Tue, 09 Jun 2015 20:49:58 +0000 |
| Subject: | How to interrupt function execution after X seconds? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-324946@lists.php.net to get a copy of this message | ||
I execute a system call via proc_open() that usually completes in less than
one minute
Sometimes, it hangs for many hours
I want to exit this parent script after thirty (30) minutes with the error
description on STDERR and I also want that system call process killed at
this point
Although, a test script using ticks and pcntl_alarm(1800) works using a
while() loop, this does NOT work with my production system call
What am I missing?
Please, advise. Thank you
~ Mike