|
From: <php...@li...> - 2009-03-15 14:42:12
|
Hi, the code is in the CVS head. A binary is available from: => http://downloads.sourceforge.net/php-java-bridge/JavaBridgeTemplate5441rc.war?use_mirror=osdn I have tested it on Tomcat only. >From the NEWS file: Version 5.4.4.1 * Remote PHP scripts can now be accessed as usual. The code: <%@page import="java.io.*" %> <%@page import="javax.script.*" %> <%@page import="php.java.script.servlet.EngineFactory" %> <% ScriptEngine e = EngineFactory.getInvocablePhpScriptEngine (this, application, request, response, new java.net.URI("http://foo:80/myApp/JavaProxy.php")); String result = (String)((Invocable)e).invokeFunction("phpversion", new Object[]{}); ((Closeable)e).close(); out.println("yourApp running PHP version:" + result); %> Will eval "phpversion()" on the server foo and return the result. There must not be a firewall in between, the servlet thread pool must not be limited or twice the size of the PHP container's pool size, the PHP option "allow_url_include" and the Java <code>WEB-INF/web.xml</code> "promiscuous" option must be enabled. Both components should be behind a firewall. Regards, Jost Bökemeier |