Java calls from PHP using Javabridge
I am trying to learn how to invoke Java methods from开发者_JS百科 PHP using 'Java Bridge'. the following is just a test code
<?php
require_once("http://localhost:80/java/Java.inc");
$System = java("java.lang.System");
echo $System->getProperties();
?>
Whenever I run this code, the browser keeps waiting for the server for a long time and then produces the error Fatal error: Request Entity Too Large. I think it is not able to execute any java call. Can anyone please tell me what possibly can be wrong and how to debug?
require_once("http://localhost:80/java/Java.inc");
Please let me know if you found Java Bridge stable, cause i am not sure it is. Are you using it in a production environment?
Indeed. Java Bridge is not ready for production. Don't use it. Ever. Sell your PC and do something you're familier with.
Or read the documentation.
Seriously, if you cannot read documentation and don't understand what's going on, you'd better do something else.
What else do you expect when you let apache fetch the same code ad infinitum? You have to fetch it from the back end!
Use require_once("http://localhost:8080/java/Java.inc"); or simply require_once("java/Java.inc") as described in the documentation. If you don't unserstand what's going on you cannot invent URL's and hope that they'll work somehow.
精彩评论