• [deleted]

In Perl, you can assign a sub routine to one of the $SIG{...}'s, fork a child process, set an alarm to timeout the process in the child, if the process (e.g., some commands inside backticks) worked within the "timeout" limit, alarm(0)is called and the %SIG is not prompted. If the command(s) inside the backticks takes too long, "alarm" will go off and prompt the $SIG{...} to call the sub routine, which probably kills the child process and give a flag...

  1. Is there a similar process in PHP? if yes, how?
  2. Does PHP support the %SIG?

Related Perl functions:
alarm( timeout )
fork()
waitpid( pid, flag)

    a month later

    Did you find the answer to your fork() / alarm() question in PHP?

      • [deleted]

      I have spent hours searching the answer, The result is not encouraging.
      Just as someone's message, PHP wasn't built to handle those system problems, rather, it was mainly used for web... However, in the long run, as it gets more and more popular, people are going to use it in more areas than we first expected.

        6 months later

        dang, I need this answer also

          13 days later

          Very interesting! But it is not documented... How does one use an undocumented fork?

            Write a Reply...