Tuesday 15 September 2015

Execute java class in PHP -



Execute java class in PHP -

i want phone call java programme , fetch it's output in stdout. followed suggestions in stackoverflow. doesn't work.

i have add together class file classpath. , can execute command in cmd correctly follows:

in php file phone call programme

exec("java hello", $output); print_r($output);

it yields nil but:

array()

what problem? how can prepare this?

ps: hello demo program, programme want phone call much more complicated might take 2 or more seconds in machine(i5 4g).

i recommend using java/php bridge found here: http://php-java-bridge.sourceforge.net/pjb/ it's quite easy install , works well.

also, recommend using next link download it. (it's same 1 link in downloads->documentation)

http://sourceforge.net/projects/php-java-bridge/files/binary%20package/php-java-bridge_6.2.1/php-java-bridge_6.2.1_documentation.zip/download

the file javabridge.war. you'll want utilize tomcat java ee container. 1 time tomcat set up, set file in webapps folder , it's installed.

if want regularly utilize java classes in php best method know of , have tried lot of them. resin worked, didn't play nice mail service server.

java php

No comments:

Post a Comment