I have a working web php app. I'm working on win 7 and using apache.
Now I'm trying to execute this java command in php and display result on site:
exec("java -jar C:\webroot\ipt\themes\ipt\views\site\Skills.jar 5 10 5.5 10 2 5 8 3 10 6 11 2 15 4", $output);
for ($index = 0; $index < count($output); $index++) {
echo $output[$index]." ";
}
However $output is an empty array - no output. I'm not getting any error or crash. Output is only a basic string. I tried to enter this same command in cmd and it work as it should - returning expected output.
So I tried different command to see if it's not problem with exec(), so I tried 'ipconfig' which displayed output on site flawlesly.
Because of this I think it has something to do with either PHP or Apache (or both).
I searched for some similar problems of other people and tried:
- entering full path of java to the command: C:\Program Files (x86)\Java\jre1.8.0_20\bin\java - jar ... - didn't work
- to change permisions to the .jar file to full access (including parent directories) - didn't work.
So I want to ask if someone doesn't know solution to this problem.
Thanks