|
From: <php...@li...> - 2008-12-30 22:10:51
|
I have the PHP-Java bridge working fine on a single server with the JAVA
Standalone config.
I am trying to get the communication working between my PHP server and my
remote Tomcat. I have copied the war file into the webapps and when
starting tomcat it created it's folder.
In the Java.inc on the tomcat box I have an echo"got to tomcat" so I know
that I am getting to the include. I can't get any of the demos or the code
provided in the readme working.
<?php
ini_set("allow_url_include", 1);
require_once("http://my_remote_tomcat:8080/JavaBridge/java/Java.inc");
$string = new Java("java.lang.String", "HelloWorld");
echo $string;
?>
The only entries in the tomcat logs are:
67.244.244.204 - - [30/Dec/2008:16:19:44 -0500] "GET
/JavaBridge/java/Java.inc HTTP/1.0" 200 66991
67.244.244.204 - - [30/Dec/2008:16:20:00 -0500] "PUT
/JavaBridge/JavaBridge.phpjavabridge HTTP/1.0" 200 43
When I startup the JavaBridge.jar I get the same results as when I'm using
Tomcat.
TIA, Jeff
|
|
From: <php...@li...> - 2008-12-30 22:30:45
|
IBM has had a good introduction: http://www.ibm.com/developerworks/aix/library/au-javaphpaix5/index.html#resources >From their article: Listing 6. Uncommenting the block to allow remote access to Java classes <init-param> <param-name>promiscuous</param-name> <param-value>On</param-value> </init-param>... Your PHP Java Bridge installation works by importing a PHP include file directly from the remote Java application server. Unfortunately, just as the PHP Java Bridge wouldn't allow remote access, default PHP installations ban the remote inclusion of files, as it is a potential security risk. You need to enable two PHP configuration parameters, allow_url_fopen, which allows you to open a remote file as if it were a local one, and allow_url_include, which enables you to include remote PHP files to import code. ;;;;;;;;;;;;;;;;;; ; Fopen wrappers ; ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. allow_url_fopen = On allow_url_include = On ... Listing 9. Creating a file on your Web server <? require_once("http://sulaco.mcslp.pri:8080/JavaBridge/java/Java.inc"); $System = new Java("java.lang.System"); print_r($System->getProperties()); ?> Peter |
|
From: <php...@li...> - 2008-12-30 22:37:17
|
Thanks Peter. I found that information in the /JavaBridge/settings.php and was just trying to figure out where to turn it on. That was a big help. The PHP side is fine I was missing that on the tomcat side. Jeff On Tue, 2008-12-30 at 14:30 -0800, php...@li... wrote: > IBM has had a good introduction: http://www.ibm.com/developerworks/aix/library/au-javaphpaix5/index.html#resources > > > >From their article: > > Listing 6. Uncommenting the block to allow remote access to Java classes > <init-param> > <param-name>promiscuous</param-name> > <param-value>On</param-value> > </init-param>... > > Your PHP Java Bridge installation works by importing a PHP include file directly > from the remote Java application server. Unfortunately, just as the PHP Java > Bridge wouldn't allow remote access, default PHP installations ban the remote > inclusion of files, as it is a potential security risk. > > You need to enable two PHP configuration parameters, > allow_url_fopen, which allows you to open a remote file > as if it were a local one, and allow_url_include, which > enables you to include remote PHP files to import code. > ;;;;;;;;;;;;;;;;;; > ; Fopen wrappers ; > ;;;;;;;;;;;;;;;;;; > > ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. > allow_url_fopen = On > allow_url_include = On > ... > > Listing 9. Creating a file on your Web server > > <? > require_once("http://sulaco.mcslp.pri:8080/JavaBridge/java/Java.inc"); > $System = new Java("java.lang.System"); > print_r($System->getProperties()); > ?> > > > Peter > > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2008-12-30 23:02:08
|
It seems that trying
$string = new Java("java.lang.String", "HelloWorld");
Causes the max script execution time to timeout before it get a response
from tomcat.
Jeff
On Tue, 2008-12-30 at 15:37 -0700,
php...@li... wrote:
> Thanks Peter. I found that information in the /JavaBridge/settings.php
> and was just trying to figure out where to turn it on. That was a big
> help. The PHP side is fine I was missing that on the tomcat side.
>
> Jeff
>
>
>
> On Tue, 2008-12-30 at 14:30 -0800,
> php...@li... wrote:
> > IBM has had a good introduction: http://www.ibm.com/developerworks/aix/library/au-javaphpaix5/index.html#resources
> >
> >
> > >From their article:
> >
> > Listing 6. Uncommenting the block to allow remote access to Java classes
> > <init-param>
> > <param-name>promiscuous</param-name>
> > <param-value>On</param-value>
> > </init-param>...
> >
> > Your PHP Java Bridge installation works by importing a PHP include file directly
> > from the remote Java application server. Unfortunately, just as the PHP Java
> > Bridge wouldn't allow remote access, default PHP installations ban the remote
> > inclusion of files, as it is a potential security risk.
> >
> > You need to enable two PHP configuration parameters,
> > allow_url_fopen, which allows you to open a remote file
> > as if it were a local one, and allow_url_include, which
> > enables you to include remote PHP files to import code.
> > ;;;;;;;;;;;;;;;;;;
> > ; Fopen wrappers ;
> > ;;;;;;;;;;;;;;;;;;
> >
> > ; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
> > allow_url_fopen = On
> > allow_url_include = On
> > ...
> >
> > Listing 9. Creating a file on your Web server
> >
> > <?
> > require_once("http://sulaco.mcslp.pri:8080/JavaBridge/java/Java.inc");
> > $System = new Java("java.lang.System");
> > print_r($System->getProperties());
> > ?>
> >
> >
> > Peter
> >
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > php-java-bridge-users mailing list
> > php...@li...
> > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|