Quantcast
Channel: Serverphorums.com
Viewing all articles
Browse latest Browse all 23908

[PHP] How to interrupt function execution after X seconds?

$
0
0
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

Viewing all articles
Browse latest Browse all 23908

Trending Articles