title: php : Capturing the command output
body: <p>I am using exec function to execute the specific executable files in php .  </p>
  
  <pre><code>exec ( $file , $output , $return_value  ) ;
  </code></pre>
  
  <p>When the given file executed successfully I am able to get the output in the second argument 
  by checking the return values , So, It is working fine. But My requirement is when the command execution getting failed due to some reason.  I need to get that error message of that executed program . What I need to do to get the error . through second argument we can get the  successful output only . Not error message. </p>
  
  <p>Thanks. </p>