title: PHP get PID of system() command
body: <p>I'm trying to find the PID of a background system call I'm making from a php webpage. If I call 'ps -A' from within the PHP script and print it to my browser, it doesn't have the same output as calling 'ps -A' from my terminal. This is particularly frustrating because I can see the PID of the background process that PHP called from my terminal, but not from within PHP.</p>
  
  <p>In other words, my code looks like this:</p>
  
  <pre><code>system("process &amp;");
  system("ps -A");
  </code></pre>
  
  <p>But that doesn't produce the same output as calling 'ps -A' from the terminal. Not only that, but 'process' shows up in terminal, but not from the PHP call.</p>
  
  <p>Can anybody explain to me why this is and how I could get the PID of 'process' from within my PHP code? (For the record, I've also tried using variations of the code including using exec() and passthru(), none of which have worked so far.)</p>
  
  <p>Thanks.</p>