从呼叫PHP5 Java方法 [英] Call Java method from PHP5

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

问题描述

曾经有一个 PHP扩展可能加载Java库和在其中调用方法。这是PHP 4。

There used to be a PHP extension that could load Java libraries and call methods in them. That was for PHP 4.

有没有办法做PHP 5中的一样吗?

Is there a way to do the same in PHP 5?

推荐答案

看起来不像有一个内置的方式,即使在PHP4的支持是实验性的。并没有真正意义的启动Java虚拟机对PHP的每个请求。你总是可以使用shell转义功能(反引号操作符),如果你有做一些在Java中,但如果你想做出点可扩展的它需要它自己的Java服务和接受SOAP / REST或但是你想谈谈它从PHP。

Doesn't look like there's a built-in way, even the support in php4 was experimental. Doesn't really make sense to start up a Java Virtual Machine on each request for php. You could always use the shell-escaping capabilities (backtick operator) if you have to do something in Java but if you want to make something scalable it needs to be its own Java service and accept SOAP/REST or however you want to talk to it from php.

这篇关于从呼叫PHP5 Java方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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