title: PHP ffmpeg exec returns null
body: <p>I'm trying to run ffmpeg through a PHP exec call, I've been debugging for a while and looked at lot of responses on here, but still not found any answers...</p>
  
  <p>My simplified call is:</p>
  
  <pre><code>$cmd = 'ffmpeg 2&gt;&amp;1';
  
  exec(escapeshellcmd($cmd), $stdout, $stderr);
  
  var_dump($stderr);
  var_dump($stdout);
  var_dump($cmd);
  exit;
  </code></pre>
  
  <p>My output is $stderr = int(1) and $stdout = array(0) { }</p>
  
  <p>Also I tried <code>shell_exec($cmd)</code> which returns <code>NULL</code>.</p>
  
  <p>cmd.exe has permissions set for the IUSR account - e.g. I can run <code>$cmd = 'dir'</code> and see a directory listing output.</p>
  
  <p>PHP is not running in safe mode.</p>
  
  <p>The ffmpeg.exe is in the same directory as my php file, but I have the same response giving an absolute path to the ffmpeg.exe file in <code>$cmd</code>.</p>
  
  <p>ffmpeg is executing fine from the command line.</p>
  
  <p>I'm running Windows XP, IIS and PHP 5.3.</p>
  
  <p>EDIT:</p>
  
  <p>If I run 'ffmpeg -h' I get the help commands, which must indicated that ffmpeg is recognised</p>
  
  <p>I've increased the PHP memory limit to 1024 - no luck.</p>