Ok so I am trying to execute a .jar file from php being run on apache (which is running on Red Hat Enterprise 9). It doesn't do anything. It is supposed to create a results file but it does nothing. I created a test php page that only has
Code:
shell_exec("/usr/java/jdk1.6.0_17/bin/java -cp /home/me/public_html/AGD/AGDMethod.jar -jar /home/me/public_html/AGD/AGDMethod.jar -R 2 -I 150 -T 0.00001 -C 2 -P /home/me/public_html/AGD/Datalehlh6c081dp9es1nfeodear04/textarea.1260163169");
and an echo statement.
I have spent hours on google trying to find the answer but I'm clueless. The above command runs from the command line so it has something to do with it being run from apache. I read somewhere about needing to modify a PATH variable for the apache user but I don't know how/where to change that, and I thought by including the whole /usr/java stuff would satisfy that. Also I read about using -cp to specify the class path so I included the -cp /home/me stuff and it still didn't help when running it from php.
other variations of the code I have tried
Code:
shell_exec("java -jar AGDMethod.jar -R 2 -I 150 -T 0.00001 -C 2 -P ./Datalehlh6c081dp9es1nfeodear04/textarea.1260163169");
the .jar is in the same location as the index.php and test.php calling it so I thought it would work that way
Code:
shell_exec("java -jar /home/me/public_html/AGD/AGDMethod.jar -R 2 -I 150 -T 0.00001 -C 2 -P /home/me/public_html/AGD/Datalehlh6c081dp9es1nfeodear04/textarea.1260163169");
Code:
shell_exec("/usr/java/jdk1.6.0_17/bin/java -jar /home/me/public_html/AGD/AGDMethod.jar -R 2 -I 150 -T 0.00001 -C 2 -P /home/me/public_html/AGD/Datalehlh6c081dp9es1nfeodear04/textarea.1260163169");
I can make any changes necessary I just don't know what to change.
Thanks in advance for any help
EDIT- someone or something changed something because now we cannot run java from apache at all (it can be run on the server from command line though)