Set the identity of executor for Apache
Before run your php program.You have to set the identity of executor for Apache.
Write a toy program
// Set Enviromental Variable$JAVA_HOME = "C:\\\"Program Files\"\\Java\\\"jre1.8.0_20";
$PATH = "C:\\\"Program Files\"\\Java\\\"jre1.8.0_20\"\\bin";
putenv("JAVA_HOME=$JAVA_HOME");
putenv("PATH=$PATH");
//run your jar program
echo shell_exec("java.exe -version 2>x.txt");
沒有留言:
張貼留言