I created a custom java program to display the license and try to run it in php.
$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);
The problem is that $ license is empty every time, I tried to print the $ command using
echo $command;
and then executed this command directly in the linux terminal, and the xml output was correct.
I use
System.out.println()
in a java application to print all xml output. I tried something simple like
shell_exec('ls -l') ;
and of course if it works.
What can i do wrong?
source
share