title: PHP exec() returning empty array (no output) when executing java -jar command
body: <p>I have a working web php app. I'm working on win 7 and using apache.</p>
  
  <p>Now I'm trying to execute this java command in php and display result on site:</p>
  
  <pre><code>exec("java -jar C:\webroot\ipt\themes\ipt\views\site\Skills.jar 5 10 5.5 10 2 5 8 3 10 6 11 2 15 4", $output);
  
      for ($index = 0; $index &lt; count($output); $index++) {
          echo $output[$index]." ";
      }
  </code></pre>
  
  <p>However $output is an empty array - no output.
  I'm not getting any error or crash. Output is only a basic string.
  I tried to enter this same command in cmd and it work as it should - returning expected output.</p>
  
  <p>So I tried different command to see if it's not problem with exec(), so I tried 'ipconfig' which displayed output on site flawlesly.</p>
  
  <p>Because of this I think it has something to do with either PHP or Apache (or both).</p>
  
  <p>I searched for some similar problems of other people and tried:</p>
  
  <ul>
  <li>entering full path of java to the command: C:\Program Files (x86)\Java\jre1.8.0_20\bin\java - jar ... - didn't work</li>
  <li>to change permisions to the .jar file to full access (including parent directories) - didn't work.</li>
  </ul>
  
  <p>So I want to ask if someone doesn't know solution to this problem.</p>
  
  <p>Thanks</p>