S
S
Sa7ha_S2015-12-03 19:28:04
PHP
Sa7ha_S, 2015-12-03 19:28:04

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

1 answer(s)
N
nirvimel, 2015-12-03
@Sa7ha_S

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 YourClassin which the method is defined public static void main(String[] args):

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question