title: Executing linux commands with PHP
body: <p>I'm trying to execute a linux command through a PHP command-line script, which is no problem using the exec command.</p>
  
  <p>The problem is, the command I am executing (mysqldump) outputs an error message if something is wrong (for example user/password is incorrect). I can't seem to be able to capture this error in order to log it. It just prints this error to the screen.</p>
  
  <p>How do I cause this error not to be printed to the screen, but instead to put it in a variable for use in my script?</p>
  
  <p>Thanks!</p>