title: php shell_exec("java -version") returning null
body: <p>I'm using the command:</p>
  
  <pre><code>shell_exec("java -version");
  </code></pre>
  
  <p>to detect what Java version is installed.   Java IS installed. The PHP script runs under the user "daemon".  Running this command from the command line:</p>
  
  <pre><code>su daemon -c 'java -version'
  </code></pre>
  
  <p>outputs </p>
  
  <pre><code>java version "1.6.0_27"
  OpenJDK Runtime Environment (IcedTea6 1.12.1) (6b27-1.12.1-2ubuntu0.12.04.2)
  OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
  </code></pre>
  
  <p>I know using shell_exec works with Java and PHP because elsewhere in the code I'm running java .jar files using it.</p>
  
  <p>Am I missing something here?</p>