title: PHP command shell_exec() not working for my custom Java app5
body: <p>I have made a custom java program to output a license and am trying to run it in php.</p>
  
  <pre><code>$deviceid="12345";
  $command_app = 'java -jar /home/myname/secure/mycommand.jar ';
  $privateKey = 'QEFAASCAmEwggJdAgE';
  $command_app_args = "\"$privateKey\" deviceid=$deviceid";
  $command=$command_app.$command_app_args;
  $license = shell_exec($command);
  </code></pre>
  
  <p>The problem is that $license is empty every time, I tried to print out the $command using </p>
  
  <pre><code>echo $command;
  </code></pre>
  
  <p>and then ran that command directly in the linux terminal and the xml output was correct.</p>
  
  <p>I am using </p>
  
  <pre><code>System.out.println() 
  </code></pre>
  
  <p>in the java app to print all the xml output.  I tried something simple like </p>
  
  <pre><code>shell_exec('ls -l') ;
  </code></pre>
  
  <p>and sure enough if worked.</p>
  
  <p>What might I be doing wrong?</p>