Hi Fabio,
> We are trying to access a Java class (standalone app) inside a PHP page.
> We followed the instructions on
> http://php-java-bridge.sourceforge.net/pjb/standalone.php
If you run PHP from a web server please read
http://php-java-bridge.sourceforge.net/pjb/webapp.php
instead. I will rename the "standalone" guide to "java-desktop-apps".
The simple back end container built into the standalone JavaBridge.jar
does work for web apps, but it isn't very efficient.
> require_once("http://localhost:8085/JavaBridge/java/Java.inc");
If you have followed the guide, this should be port 8087.
> But nothing worked.
I am sorry, but I cannot reproduce this problem. Can you access the
Java.inc URL from your web browser or "wget"? Can you please log into
the host running the HTTP server and type:
wget http://localhost:8085/JavaBridge/java/Java.inc
This command should fetch the Java.inc file. If that worked, your HTTP
server should be able to access the back end, unless it is running in
its own "sandbox".
> Is there any more configuration needed? Maybe some related to SSL on
> PHP...
Not directly, no. But it may be that your system administrator has
locked the HTTP server, so that it cannot access resources on this
computer.
> We would like also to avoid the use of URL on the requice_once call.
You can copy Java.inc to some directory and adjust the JAVA_HOSTS
definition. For example
require("http://host.com:8888/JavaBridge/java/Java.inc);
is equivalent to
define ("JAVA_HOSTS", "host.com:8888");
require("path/to/my/Java.inc");
Regards,
Jost Bökemeier
|