PHP exec function
• 26 Oct 2011, 09:29 • Journals
I want to start a java program (.jar file) with a php script got this script in my www folder (wampserver) and want to start file.jar(that is also in my www folder.) How can i do this already looked up at google but this code always fail. So somebody any idea. (the program need to open at the foreground.)
exec('java -jar jar.jar', $output);
and i tried this:
i tried this on 127.0.0.1/test.php
and my browser keeps loading so nothing happend, also tried this without the $output but same result.
Anything you execute using exec must terminate.
$command = "c:\\Windows\\notepad.exe";
it works like this now the only problem is it wil run as a proces on the background and the User is SYSTEM any idea how to change this?
E: echo exec('file.jar');