Problems running a Java program from within PHP
<p>I'm writing a PHP script that basically calls a Java program with a string, has Java create a file whose name is that string, and returning that file. Also, it's all midi.</p>

<pre><code>$output_file = mt_rand(10000000,99999999) . ".mid";
system("java MCS " . $_FILES["file"]["tmp_name"] . " " . $output_file . " " . escapeshellarg($_POST['message']));
header('Content-type: audio/midi');
header('Content-Disposition: attachment; filename="output.mid"');
readfile($output_file);
unlink($output_file);
</code></pre>

<p>Only problem is I get this problem: Error occurred during initialization of VM java.lang.Error: Properties init: Could not determine current working directory. </p>

<p>I have tried using <code>exec</code>. The script completes but the java program doesn't run.</p>
