How can I run a Symfony2 process in background?
My code:
class Start extends Symfony\Component\Console\Command\Command {
protected function configure() {
$this->setName('start');
}
protected function execute(InputInterface $input, OutputInterface $output) {
$process = new Process('java -jar ./selenium-server-standalone-2.42.2.jar');
$process->setTimeout(null);
$process->start();
$pid = $process->getPid();
$output->writeLn(sprintf('Started selenium with PID %d', $pid));
$process->wait();
}
}
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?