Hi I am attempting to execute a jar from PHP 5
Here is the code I am executing:
$command = '"java -jar WEB-INF\\lib\\FileReceiver.jar '.$address.' '.$service_port.' \"'.$command.'\" \"'.$filePath.'\""';
exec($command, $out);
But the jar is not being executed. I had logged the $command variable in firebug and took the output and inserted into the code such as:
exec("java -jar WEB-INF\lib\FileReceiver.jar 127.0.1.1 2018 \"docs/document.txt \" \"C:\\apache-tomcat-7.0.26\\webapps\\test\\downloads\\doument.txt\"", $out);
gives the correct output. I dont understand why hard coding it works but the variable which contains the same information does not.
Could someone help me out?
Thanks
$adress$service_port$commandand$filepathhave the right values?