title: How to start and stop PHP dev server with exec()
body: <p>How can I start and stop PHP dev server with exec() function? I need to do this in order to automate my BDD tests.</p>
  
  <p>This stops execution of my script:</p>
  
  <pre><code>echo exec('php -S localhost:8000');
  </code></pre>
  
  <p>So I need a way to start the server from PHP and be able to continue executing my test. And then I also need a way to stop it from PHP.</p>