title: How can I debug exec() problems?
body: <p>The exec command doesn't work on my server, it does not do anything, I've had safe_mode off, and verified that all the console commands are working, I've tried with absolute paths. I've checked the permissions on the applications and all the applications I need have execution permissions. I don't know what else to do, here are the rundown of the codes I've tried.</p>
  
  <pre><code>echo exec('/usr/bin/whoami');
  
  echo exec('whoami');
  
  exec('whoami 2&gt;&amp;1',$output,$return_val);
  if($return_val !== 0) {
      echo 'Error&lt;br&gt;';
      print_r($output);   
  }
  
  exec('/usr/bin/whoami 2&gt;&amp;1',$output,$return_val);
  if($return_val !== 0) {
      echo 'Error&lt;br&gt;';
      print_r($output);   
  }
  </code></pre>
  
  <p>The last two codes display:</p>
  
  <pre><code>Error
  Array ( )
  </code></pre>
  
  <p>I've contacted the server service and they can't help me, they don't know why the exec command isn't working.</p>