title: PHP exec() unable to access .jar file
body: <p>I'm setting up a form on my website. I want the PHP code that handles emailing info about the form to me to also run a java program printing information about it. Here is my PHP code</p>
  
  <pre><code>$name = $_POST['name']; 
  $email_address = $_POST['email']; 
  $date = $_POST['date'];
  $time = $_POST['time'];
  $message = $_POST['message']; 
  $info = array($name, $email_address, $date, $time, $message);
  
  exec('java -jar "C:\SomePathTo\HelloWorld.jar" $info 2&gt;&amp;1' , $output);`
  var_dump($output);
  </code></pre>
  
  <p>And my <strong>Java code</strong></p>
  
  <pre><code>public class HelloWorld {
      public static void main(String[] args) {
          for(int i = 0; i &lt; args.length; i++) {
              System.out.println(args[i]);
          }
      }
  }
  </code></pre>
  
  <p>When my website runs this code I get the following output/<strong>error message</strong></p>
  
  <pre><code>array(1) { [0]=&gt; string(197) "Error: Unable to access jarfile C:\SomePathTo\HelloWorld.jar" }
  </code></pre>
  
  <p>Help!</p>