Call java code from PHP

I have a PHP web application developed using the Symfony framework. I want to call some Java code from my PHP pages. Java code extends to several jar files, and a single interface is available to access functions. The input and output of the Java interface are XML files, text files, Java beans, and some more complex objects.

Is there any bridge available in PHP to call complex Java methods or another solution to this problem. Alternatively, I should write soapy web services to solve this problem.

+4
source share
2 answers
+8
source

you can run java code using exec or shell_exec ex.

shell_exec("java whatever.jar $parameter1 $parameter2"); 

However, web services would be a better solution. IMO

+7
source

Source: https://habr.com/ru/post/1346909/


All Articles