I can not call java from php
<p>The system variable 'Path' contains <code>C:\Program Files\Java\jre7\bin\</code>
It seems like, I cant even access java from PHP. The system is Windows Server 2012. From the cmd terminal, java works fine.</p>

<p>When I call the java command via <code>exec</code> from php like this:</p>

<pre><code>exec("java -version", $string);
preg_match("/java version \"(.*)\..*.*\"/", $string[0], $matches);
$java_version = $matches[1];
</code></pre>

<p><code>$java_version</code> is null. </p>

<p>Any ideas?</p>

<hr>

<p>I suspect, it has something to do with access rights on Windows, might that be?</p>