Php / Java集成 [英] Php/Java Integration

查看:87
本文介绍了Php / Java集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否有过PHP和Java集成的经验?我用Java编写了一个类Hello。现在我想从php调用它的方法,当我从php创建这个类的实例时

Have you experience of integration of php and Java? I've written a class in Java "Hello". Now I want to call its method from php when I create an instance of this class from php with

$obj = new Java(Hello);

然后它给了我致命的错误。我已经多次尝试设置php ini变量等但我找不到任何东西。请指教我如何设置它。

Then it gives me fatal error. I've tried many times to setup php ini variables etc but I couldn't find anything. Please advice me how can I set it up.

提前致谢

参考: http://php.net/manual/en/book.java.php

推荐答案

看看:

PHP-Java Bridge


PHP / Java Bridge是
实现流式传输,
基于XML的网络协议,可以
用于连接本机脚本
引擎,例如PHP,Scheme或
Python,带有Java虚拟机。
它通过SOAP比本地
RPC快50倍,在Web服务器端需要更少的资源
。通过Java Native
接口比
直接通信更快
和更可靠,并且它不需要
额外的组件来从PHP或PHP程序调用Java
过程来自Java的

The PHP/Java Bridge is an implementation of a streaming, XML-based network protocol, which can be used to connect a native script engine, for example PHP, Scheme or Python, with a Java virtual machine. It is up to 50 times faster than local RPC via SOAP, requires less resources on the web-server side. It is faster and more reliable than direct communication via the Java Native Interface, and it requires no additional components to invoke Java procedures from PHP or PHP procedures from Java.

这篇关于Php / Java集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆