title: How to retrieve PHP exec() error responses?
body: <p>Below is the command I tried executing, without success:</p>
  
  <pre><code>exec('ln -s ' . PLUGIN_DIR . '/.htaccess ' . ABSPATH . '/.htaccess');
  </code></pre>
  
  <p>When you add a die() at the end, it catches that there's an error:</p>
  
  <pre><code>exec('ln -s ' . PLUGIN_DIR . '/.htaccess ' . ABSPATH . '/.htaccess') or die('what?!');
  </code></pre>
  
  <p>For the above exec() statement, a permissions problem is causing the error, but PHP isn't displaying it. How do you display from PHP what error is occurring?</p>