From: <php...@li...> - 2010-06-14 16:32:24
|
hi, i installed php-java bridge to a tomcat server. if i try the examples i always get "Fatal error: Cannot redeclare java() in http://localhost:8080/JavaBridge/java/Java.inc on line 81". I'm running zend server with php 5.2.13 on a debian machine. Any ideas whats wrong?* *regards, Thomas* * |
From: <php...@li...> - 2010-06-14 18:26:50
|
Hi, > i installed php-java bridge to a tomcat server. if i try the examples i > always get "Fatal error: Cannot redeclare java() in > http://localhost:8080/JavaBridge/java/Java.inc on line 81". > I'm running zend server with php 5.2.13 on a debian machine. Any ideas whats > wrong?* Please see our FAQ entry "I get a blank page or some other error!?!" at http://php-java-bridge.sourceforge.net/pjb/FAQ.html : If the command: echo '<?php require_once("http://localhost:8080/JavaBridge/java/Java.inc"); echo java("java.lang.System")->getProperties();?>' | php -n -d allow_url_include=On works in the shell but not within apache, then there's something wrong with your php.ini file. Regards, Jost Boekemeier |
From: <php...@li...> - 2010-06-15 10:41:12
|
Am 14.06.2010 20:26, schrieb php...@li...: > Hi, > > > >> i installed php-java bridge to a tomcat server. if i try the examples i >> always get "Fatal error: Cannot redeclare java() in >> http://localhost:8080/JavaBridge/java/Java.inc on line 81". >> I'm running zend server with php 5.2.13 on a debian machine. Any ideas whats >> wrong?* >> > > Please see our FAQ entry "I get a blank page or some other error!?!" > at http://php-java-bridge.sourceforge.net/pjb/FAQ.html : > > If the command: > > echo '<?php > require_once("http://localhost:8080/JavaBridge/java/Java.inc"); echo > java("java.lang.System")->getProperties();?>' | php -n -d > allow_url_include=On > > works in the shell but not within apache, then there's something wrong > with your php.ini file. > > > Regards, > Jost Boekemeier > indeed the shell command worked. The problem was, that the Zend Java Bridge Component was loaded. After deactivating it, it works as expected. regards, Thomas |
From: <php...@li...> - 2010-06-15 11:21:41
|
FYI: I have changed the quotes, so that the test command now works on both Unix and Windows. From the updated FAQ: If the command: echo "<?php require_once('http://localhost:8080/JavaBridge/java/Java.inc'); echo java('java.lang.System')->getProperties();?>" | php -n -d allow_url_include=On works in the shell but not within apache, then there's something wrong with your php.ini file. And while testing I've noticed another regression in 6.1.2.1 (due to the refactoring of FastCGIServlet): http://php-java-bridge.cvs.sourceforge.net/viewvc/php-java-bridge/php-java-bridge/server/php/java/servlet/fastcgi/FastCGIServlet.java?r1=1.29&r2=1.30 You might want to use the latest PHP/Java Bridge 5.x release or the current CVS, if you want to use jsp:include page="foo.php". Regards, Jost Boekemeier On 6/15/10, php...@li... <php...@li...> wrote: > Am 14.06.2010 20:26, schrieb php...@li...: >> Hi, >> >> >> >>> i installed php-java bridge to a tomcat server. if i try the examples i >>> always get "Fatal error: Cannot redeclare java() in >>> http://localhost:8080/JavaBridge/java/Java.inc on line 81". >>> I'm running zend server with php 5.2.13 on a debian machine. Any ideas >>> whats >>> wrong?* >>> >> >> Please see our FAQ entry "I get a blank page or some other error!?!" >> at http://php-java-bridge.sourceforge.net/pjb/FAQ.html : >> >> If the command: >> >> echo '<?php >> require_once("http://localhost:8080/JavaBridge/java/Java.inc"); echo >> java("java.lang.System")->getProperties();?>' | php -n -d >> allow_url_include=On >> >> works in the shell but not within apache, then there's something wrong >> with your php.ini file. >> >> >> Regards, >> Jost Boekemeier >> > indeed the shell command worked. The problem was, that the Zend Java > Bridge Component was loaded. After deactivating it, it works as expected. > > regards, Thomas > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
From: <php...@li...> - 2010-06-16 10:32:11
|
In order to get a java-bridge configuration up and running I initially set my PHP open_basedir to "/". For security reasons I now want to restrict the open_basedir path to within the webserver document root. I had an issue with attempts to access "/dev/shm/", which I fixed by changing JAVA_PIPE_DIR in: /var/lib/tomcat5.5/webapps/JavaBridge/java/Java.inc However, having done so I now find that files in /tmp are being accessed, such as: "/tmp/.php_java_bridgejNmYsU.i". I can't see where this location is being set. Does anyone have any ideas? The full error log is: ========================================================================================= Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/tmp/.php_java_bridgejNmYsU.i) is not within the allowed path(s): (/home/josepht/DEV) in http://localhost:8080/JavaBridge/java/Java.inc on line 846 Warning: fopen(/tmp/.php_java_bridgejNmYsU.i) [function.fopen]: failed to open stream: Operation not permitted in http://localhost:8080/JavaBridge/java/Java.inc on line 846 Warning: stream_set_blocking(): supplied argument is not a valid stream resource in http://localhost:8080/JavaBridge/java/Java.inc on line 848 Warning: stream_set_timeout(): supplied argument is not a valid stream resource in http://localhost:8080/JavaBridge/java/Java.inc on line 849 Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/tmp/.php_java_bridgejNmYsU.o) is not within the allowed path(s): (/home/josepht/DEV) in http://localhost:8080/JavaBridge/java/Java.inc on line 850 Warning: fopen(/tmp/.php_java_bridgejNmYsU.o) [function.fopen]: failed to open stream: Operation not permitted in http://localhost:8080/JavaBridge/java/Java.inc on line 850 Warning: unlink() [function.unlink]: open_basedir restriction in effect. File(/tmp/.php_java_bridgejNmYsU.i) is not within the allowed path(s): (/home/josepht/DEV) in http://localhost:8080/JavaBridge/java/Java.inc on line 851 Warning: unlink() [function.unlink]: open_basedir restriction in effect. File(/tmp/.php_java_bridgejNmYsU.o) is not within the allowed path(s): (/home/josepht/DEV) in http://localhost:8080/JavaBridge/java/Java.inc on line 852 Warning: unlink() [function.unlink]: open_basedir restriction in effect. File(/tmp/.php_java_bridgejNmYsU) is not within the allowed path(s): (/home/josepht/DEV) in http://localhost:8080/JavaBridge/java/Java.inc on line 853 Warning: stream_set_timeout(): supplied argument is not a valid stream resource in http://localhost:8080/JavaBridge/java/Java.inc on line 854 Warning: fwrite(): supplied argument is not a valid stream resource in http://localhost:8080/JavaBridge/java/Java.inc on line 858 Broken local connection handle fwrite(): supplied argument is not a valid stream resource |
From: <php...@li...> - 2010-06-16 13:55:11
|
Hi, which version of the PHP/Java Bridge do you use? As of version 6 the bridge doesn't use named pipes anymore; the code is gone. In PHP/Java Bridge version 5 you can switch off named pipes by define("JAVA_PIPE_DIR", null). > However, having done so I now find that files in /tmp are being > accessed, such as: "/tmp/.php_java_bridgejNmYsU.i". Unlikely. If JAVA_PIPE_DIR is null, the path would be "null/.php_java_bridgejNmYsU.i" > I can't see where this location is being set. Does anyone have any ideas? Neither do I. Why don't you switch to version 6.1.2.1. t has some issues, mostly regressions for features introduced in 5.x. But overall it is running fine. Regards, Jost Boekemeier |
From: <php...@li...> - 2010-06-16 14:37:22
|
Hi, I am actually using java-bridge 6.1.2.1 Following your advice I have found that setting JAVA_PIPE_DIR to null fixes the problem. Previously I had this set to a directory within the open_basedir path. Thanks for your help. Joe On 16/06/10 14:31, php...@li... wrote: > Hi, > > which version of the PHP/Java Bridge do you use? > > As of version 6 the bridge doesn't use named pipes anymore; the code > is gone. In PHP/Java Bridge version 5 you can switch off named pipes > by define("JAVA_PIPE_DIR", null). > > > >> However, having done so I now find that files in /tmp are being >> accessed, such as: "/tmp/.php_java_bridgejNmYsU.i". >> > Unlikely. If JAVA_PIPE_DIR is null, the path would be > "null/.php_java_bridgejNmYsU.i" > > > >> I can't see where this location is being set. Does anyone have any ideas? >> > Neither do I. Why don't you switch to version 6.1.2.1. t has some > issues, mostly regressions for features introduced in 5.x. But overall > it is running fine. > > > Regards, > Jost Boekemeier > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
From: <php...@li...> - 2010-06-16 15:35:27
|
> I am actually using java-bridge 6.1.2.1 Version 6.1.2.1 doesn't have any named pipe code. Please update your Java.inc to version 6.1.2.1. Regards, Jost Boekemeier On 6/16/10, php...@li... <php...@li...> wrote: > Hi, > > I am actually using java-bridge 6.1.2.1 > > Following your advice I have found that setting JAVA_PIPE_DIR to null > fixes the problem. Previously I had this set to a directory within the > open_basedir path. > > Thanks for your help. > > Joe > > On 16/06/10 14:31, php...@li... wrote: >> Hi, >> >> which version of the PHP/Java Bridge do you use? >> >> As of version 6 the bridge doesn't use named pipes anymore; the code >> is gone. In PHP/Java Bridge version 5 you can switch off named pipes >> by define("JAVA_PIPE_DIR", null). >> >> >> >>> However, having done so I now find that files in /tmp are being >>> accessed, such as: "/tmp/.php_java_bridgejNmYsU.i". >>> >> Unlikely. If JAVA_PIPE_DIR is null, the path would be >> "null/.php_java_bridgejNmYsU.i" >> >> >> >>> I can't see where this location is being set. Does anyone have any ideas? >>> >> Neither do I. Why don't you switch to version 6.1.2.1. t has some >> issues, mostly regressions for features introduced in 5.x. But overall >> it is running fine. >> >> >> Regards, >> Jost Boekemeier >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> php-java-bridge-users mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >> > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |