title: shell_exec not working
body: <p>Here's my command:</p>
  
  <pre><code>sudo /usr/local/bin/jpegoptim --max=50 /home/someuser/public_html/reports/images/r121662.jpg
  </code></pre>
  
  <p>This command is supposed to compress an image. I tried running this command using backtick operator and shell_exec, neither will work. The file doesn't compress.</p>
  
  <p>But this command runs when I run it directly in the shell logged in as <code>someuser</code>. I've modified <code>sudoers</code> to accept the command without requiring a password. The file is compressed when I run it in the shell.</p>
  
  <p>Apache is configured to run with suPHP, and the PHP files belong to <code>someuser</code> as well. I've further ensured this by writing a test php script just saying <code>system(id);</code> and running it in the browser. That tells me that the script is indeed being run by <code>someuser</code>.</p>
  
  <p>Also, safe_mode is off.</p>
  
  <p><strong>EDIT</strong>: Ok, I got it to output the error</p>
  
  <pre><code>sudo: sorry, you must have a tty to run sudo
  </code></pre>
  
  <p>Now, what does it mean?!</p>