title: exec() does not return to PHP process
body: <p>I am running FFMPEG from PHP with the EXEC command. I am working on a XAMP stack.</p>
  
  <pre><code>$command = 'ffmpeg -y -i input output 2&gt;logfile';
  exec ($command);
  // after FFMPEG handling...
  </code></pre>
  
  <p>As you can see, I am redirecting FFMPEG's output to a log file.</p>
  
  <p>This works fine from smaller video files (up to approximately 10 MB).</p>
  
  <p><strong>My problem is that for larger video files, any PHP commands after the exec() will not get executed.</strong> Note however, that the FFMPEG process works just fine. The log file shows that FFMPEG terminates OK, and the resulting output file is also good.</p>
  
  <p>My max_execution_time is set to 10800, which should be plenty (and then some). Anyway, as I understand from <a href="http://php.net/manual/en/function.set-time-limit.php" rel="nofollow">max_time_limit</a>: </p>
  
  <blockquote>
    <p>The set_time_limit() function and the configuration directive
    max_execution_time only affect the execution time of the script
    itself. Any time spent on activity that happens outside the execution
    of the script such as system calls using system() ... is not included
    when determining the maximum time that the script has been running.</p>
  </blockquote>
  
  <p><strong>Update:</strong> error logs state: <em>Premature end of script</em></p>
  
  <p>What is going on?</p>