title: PHP: List root's crontab with sudo
body: <p>Using PHP I would like to be able to list root's crontab.
  I am able to run the following command as the Apache user from the command line and get the desired result:</p>
  
  <pre><code>sudo crontab -l
  </code></pre>
  
  <p>however, in my PHP I have the following command which does not work and returns an empty set:</p>
  
  <pre><code>exec('sudo crontab -l', $out);
  print_r($out);
  </code></pre>
  
  <p>Is it environmental? Or permissions? </p>
  
  <p>I have also tried <code>shell_exec()</code> <code>system()</code> and <code>passthru()</code></p>
  
  <p>Also, note that I have disabled SELinux and added Apache to the sudoers file so that it does not need to be prompted for a password.</p>