title: How do you debug a LONG RUNNING php script?
body: <p>The problem is that the script hangs up after some long time. 
  <em>strace</em> returns something like this and nothing else:</p>
  
  <pre><code>Process 7286 attached - interrupt to quit
  restart_syscall(&lt;... resuming interrupted call ...&gt;) = 0
  poll([{fd=13, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
  clock_gettime(CLOCK_MONOTONIC, {1817569, 74651533}) = 0
  clock_gettime(CLOCK_MONOTONIC, {1817569, 74734744}) = 0
  clock_gettime(CLOCK_MONOTONIC, {1817569, 74812047}) = 0
  poll([{fd=13, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 0 (Timeout)
  poll([{fd=13, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
  ....
  </code></pre>
  
  <p>Putting here'n'there debug messages is left as a last resort..</p>
  
  <p>I can run the script with <em>xdebug</em> attached but is there a way to send some POSIX signal to php process which would trigger xdebug to dump current context/stacktrace/localvars?</p>
  
  <p>Is it possible to get 'postmortem dump' of php script?</p>