title: Symfony2 background process
body: <p>How can I run a Symfony2 process in background?</p>
  
  <p>My code:</p>
  
  <pre><code>class Start extends Symfony\Component\Console\Command\Command {
  
    protected function configure() {
      $this-&gt;setName('start');
    }
  
    protected function execute(InputInterface $input, OutputInterface $output) {
      $process = new Process('java -jar ./selenium-server-standalone-2.42.2.jar');
      $process-&gt;setTimeout(null);
      $process-&gt;start();
      $pid = $process-&gt;getPid();
      $output-&gt;writeLn(sprintf('Started selenium with PID %d', $pid));
      $process-&gt;wait();
    }
  
  }
  </code></pre>
  
  <p>How can I run this process in background? I guess I should redirect STDOUT of the new process to /dev/null but how can I do that?</p>