How to get the output of java apps in a php web script?
<p>I have written a Java application that runs from the command line. I want to allow users to access this via a simple PHP web interface - it'll just allow them to specify certain parameters, and then execute the java app and return the output.</p>

<p>For some reason, I'm getting a 'Permission Denied' error message when I try to do anything with Java, even something as simple as:</p>

<pre><code>shell_exec('/usr/bin/java -version 2&gt;&amp;1');
</code></pre>

<p>returns 'sh: /usr/bin/java: Permission denied ' when run through a browser.</p>

<p>If I give apache a shell account and log in as apache, I can execute this command fine.</p>

<p>Is there some kind of setting preventing the JVM running if there is no associated tty? How can I get this to work? I'm running PHP 5.3.2.</p>

<p>Thanks</p>
