Answer the question
In order to leave comments, you need to log in
How to run java ".class" from PHP?
I have a PHP script and I need to run a program with parameters from it, the program itself is written in java, please tell me, with what function can this be done?
As far as I know, when a script is launched when viewing pages in a browser, then the user who tries to run the program from the www-data group, what access rights should be assigned to the executable file so that it runs without problems?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
To begin with, Java must be installed on the server. On shared hosting, of course, nothing will work. After installing Java, you can exec('java -cp . YourClass');
run YourClass.class like this, in which the class is defined YourClass
in which the method is defined public static void main(String[] args)
:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question