From: <php...@li...> - 2006-05-31 09:16:34
|
Hi List, I've been playing around with the bridge for some time now and started to d= o=20 some 'real' work with it today. My first move was to move the php classes=20 I've used so far into separate files - which didn't work :| This code works fine: <?php =A0 =A0$session =3D java_session(); ?> Now, let's name that code file1.php. If I do <?php =A0 =A0include('file1.php'); ?> from any other file (while file1.php =A0is in the same folder or not), I'm= =20 getting the following error: =46atal error: php_mod_java(88): Protocol violation at pos 7, please check = that=20 the backend (JavaBride.war) is deployed or please switch off the java.servl= et=20 option. in ...file1.php on line 2 That goes for basically all java_ commands (e.g. java_context() instead of= =20 java_session()). Any idea how to solve that? To give some further information: I'm running the bridge inside tomcat on=20 ubuntu linux with php compiled as fastcgi. Bride resides in <tomcat=20 root>/shared/lib, as discussed in documentation. No problems at all to use= =20 the bridge from within Cheers flim |
From: <php...@li...> - 2006-05-31 09:56:47
|
Hi, answering to myself - the problem wasn't include files, that just works fin= e.=20 The problem is that the 'real' application was running on ssl port 8443=20 instead of 8080. I tried modifying the php.ini setting java.hosts, but without success -=20 java.hosts=3D"127.0.0.1:8443" will lead to the same error. Is there any way to make use of the bride usin= g=20 ssl? Cheers flim On Wednesday 31 May 2006 11:17,=20 php...@li... wrote: > Hi List, > > I've been playing around with the bridge for some time now and started to > do some 'real' work with it today. My first move was to move the php > classes I've used so far into separate files - which didn't work :| > > This code works fine: > <?php > =C2=A0 =C2=A0$session =3D java_session(); > ?> > > Now, let's name that code file1.php. If I do > <?php > =C2=A0 =C2=A0include('file1.php'); > ?> > > from any other file (while file1.php =C2=A0is in the same folder or not),= I'm > getting the following error: > > Fatal error: php_mod_java(88): Protocol violation at pos 7, please check > that the backend (JavaBride.war) is deployed or please switch off the > java.servlet option. in ...file1.php on line 2 > > That goes for basically all java_ commands (e.g. java_context() instead of > java_session()). > > Any idea how to solve that? > > To give some further information: I'm running the bridge inside tomcat on > ubuntu linux with php compiled as fastcgi. Bride resides in <tomcat > root>/shared/lib, as discussed in documentation. No problems at all to use > the bridge from within > > Cheers > flim |
From: <php...@li...> - 2006-06-04 11:22:09
|
Hi, please excuse the delay. > java.hosts="127.0.0.1:8443" > will lead to the same error. Is there any way to > make use of the bride using ssl? It cannot use SSL, no. Isn't it possible to use a dedicated HTTP port for the PHP<-->JAVA communication? For example the following entry in the tomcat server.xml should solve this: [...] <Service name="Catalina"> [...] <!-- Used by local PHP clients --> <Connector port="7777" address="127.0.0.1"/> [...] The php.ini entry would look like: extension=java.so [java] java.hosts=127.0.0.1:7777 java.servlet=On The 127.0.0.1 makes the 7777 port accessible to the local host only, it is not even visible from the internet. Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de |
From: <php...@li...> - 2006-06-04 18:19:19
|
Hi Jost, On Sunday 04 June 2006 13:21, Jost Boekemeier wrote: > It cannot use SSL, no. Isn't it possible to use a > dedicated HTTP port for the PHP<-->JAVA communication? Yes, that is possible. And it sounds like an elegant solution > For example the following entry in the tomcat > server.xml should solve this: > <Connector port=3D"7777" address=3D"127.0.0.1"/> > The php.ini entry would look like: > extension=3Djava.so > [java] > java.hosts=3D127.0.0.1:7777 > java.servlet=3DOn And it works. Sometimes :| I'm not really sure what's happening there. As said before, I'm trying to r= un=20 php within tomcat without apache (or any other webserver being involved). I= 'm=20 using JavaBridge.jar and php_servlet.jar in shared/libs with JavaBridge.war= =20 in webapps (which works just fine). conf/web.xml contains only what's advic= ed=20 on the website, conf/web.xml within JavaBridge is unchanged and=20 php-cgi-i386-linux.ini in /webapps/JavaBridge/WEB-INF/cgi/ was modified to= =20 the above. Now, after tomcat restart, it sometimes works and sometimes doesn't. I'm=20 testing my configuration with /root.php in /ROOT/, I'm=20 using /JavaBridge/test.php for testing JavaBridge in general. If I restart tomcat and access https://localhost:8443/root.php I'm getting = an=20 error telling me that php-cgi couldn't be found in /usr/bin (which is true,= =20 it doesn't exist). If I restart tomcat and access=20 http://localhost:8080/root.php it works fine. If I access 8443/root.php after restart and it fails, I won't be able to ca= ll=20 8080/root.php as well without getting an error. However, If I first call=20 8443/root.php, then 8080/JavaBridge/test.php and then again 8443/root.php, = it=20 works. Sometimes that is - sometimes it doesn't at all. I don't seem to be able to find any rule behind that. I however tested it a= =20 couple of times and it looks like this: if 8443/root.php gets called first,= =20 then I've to call 8080/JavaBridge/test.php and afterwards 8080/root.php=20 before 8443/root.php works. If I don't call the two scripts in that order, = I=20 won't get 8443/root.php to work without restarting tomcat. Oh, root.php looks like this: <?php $s =3D java_session(); //to verify I can access those methods phpinfo(); ?> (so nothing special in there - I however didn't test taking the java_sessio= n()=20 away) I can imagine that you guys are putting an incredible amount of work into t= his=20 project - let me say that it's greatly appreciated. It would be very helpfu= l=20 though, if you could extend the descriptions on the website so that they ar= e=20 easier to follow :-) Sorry for this long email - I'm uncertain if this is a bug in JavaBridge or= a=20 misconfiguration on my end and thought that if the first is true, you might= =20 need a detailed report. Best regards flim |
From: <php...@li...> - 2006-06-06 17:59:35
|
Hi, > php within tomcat without apache now I understand. This is a bug in the PHP/Java Bridge. The the PhpCGIServlet sets the environment variable X_JAVABRIDGE_OVERRIDE_HOSTS=127.0.0.1:SSL_PORT so that the java.so can connect back to the current VM, which doesn't work, of course, if the request came in from the SSL port. It must connect to the PORT specified in the php.ini file. I have opened a ticket for this, please see PR1501791 for details: http://sourceforge.net/tracker/index.php?func=detail&aid=1501791&group_id=117793&atid=679233 As a workaround, until this bug is fixed, please switch off the override_hosts setting in the web.xml: <!-- Allow us to override the java.hosts, java.servlet and --> <!-- java.socketname settings from your php.ini so that we can --> <!-- use the current VM (see X_JAVABRIDGE_OVERRIDE_HOSTS). --> <!-- Default is On. --> <init-param> <param-name>override_hosts</param-name> <param-value>Off</param-value> </init-param> and set the java.hosts and java.servlet options in the WEB-INF/cgi/php-i386-linux.ini (or whatever php ini you use). Regards, Jost Boekemeier ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de |
From: <php...@li...> - 2006-06-04 23:29:59
|
Hi, another issue came up. If I'm using the bridge as said in last email, I'm=20 getting following error randomly. I can reproduce that error by simply=20 reloading a page a couple of times. That's all on port 8080, so nothing=20 unusual. I could work around that by copying or linking the cgi directory=20 from the JavaBridge webapp to all others, but it would be inconvenient (and= I=20 think symlinks don't work - that could make it a space consumer as well). javax.servlet.ServletException: An IO exception occured. Probably php was n= ot=20 installed as "/usr/bin/php-cgi" or "c:/php5/php-cgi.exe" or "/jsmsc/srv/tomcat/webapps/ROOT/WEB-INF/cgi/php-cgi-i386-linux[.sh]| [.exe]". Please see "php_exec" in your WEB-INF/web.xml and WEB-INF/cgi/README for=20 details. php.java.servlet.PhpCGIServlet.doGet(PhpCGIServlet.java:466) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) If you could point me to a solution for this issue, I'd be more than happy.= =20 While I could somehow life with the ssl issue described in my last email,=20 this is a killer. After the error occuring it doesn't work again (so, once= =20 the error occured it will always occur). Cheers flim |
From: <php...@li...> - 2006-06-05 10:03:44
|
Hi all, I'm really giving up now. I had everything working except that strange ssl= =20 problem by having a cgi folder within each webapp. Now, I added a new host= =20 and I'm getting some 'no session proxy' exception when trying something lik= e=20 java_session(); I then removed all global stuff and deployed the JavaBridge.war to the new= =20 host. It works first time after restart, then it doesn't. No exception or=20 other error, just blank page. Any help greatly appreciated, cheers flim On Monday 05 June 2006 01:29, php...@li...=20 wrote: > Hi, > > another issue came up. If I'm using the bridge as said in last email, I'm > getting following error randomly. I can reproduce that error by simply > reloading a page a couple of times. That's all on port 8080, so nothing > unusual. I could work around that by copying or linking the cgi directory > from the JavaBridge webapp to all others, but it would be inconvenient (a= nd > I think symlinks don't work - that could make it a space consumer as well= ). > > javax.servlet.ServletException: An IO exception occured. Probably php was > not installed as "/usr/bin/php-cgi" or "c:/php5/php-cgi.exe" > or "/jsmsc/srv/tomcat/webapps/ROOT/WEB-INF/cgi/php-cgi-i386-linux[.sh]| > [.exe]". > Please see "php_exec" in your WEB-INF/web.xml and WEB-INF/cgi/README for > details. > php.java.servlet.PhpCGIServlet.doGet(PhpCGIServlet.java:466) > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > If you could point me to a solution for this issue, I'd be more than happ= y. > While I could somehow life with the ssl issue described in my last email, > this is a killer. After the error occuring it doesn't work again (so, once > the error occured it will always occur). > > Cheers > flim |
From: <php...@li...> - 2006-06-07 18:20:06
|
Hi, > I'm really giving up now. too bad. But thank you for testing the 3.1.0 release candidate anyway. > host. It works first time after restart, then it > doesn't. I could reproduce this problem with 3.1.0 rc2 and rc3. The problem appears on Unix only and is connected with a fix for passing environment variables. The current working directory was no longer set, which means that the .sh wrapper can or cannot execute the cgi binary using ./php-cgi-x86-linux. This is fixed in RC4. Please see the ChangeLog for details. > other error, just blank page. Yes, then the shell cannot execute the cgi binary it ends the shell script without writing any output. Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |
From: <php...@li...> - 2006-06-06 19:53:09
|
Hi, > getting following error randomly. How often? Is this error connected to MAX_REQUESTS in the RC2? If so, this should be fixed in the RC3. > reloading a page a couple of times. That's all on Which version of the PHP/Java Bridge do you use? One of the 3.1.0 release candidates or the official version 3.0.8? The 3.0.8 should work reliably, but both, the RC1 and RC2 have a bug in the new connection pool. > unusual. I could work around that by copying or > linking the cgi directory I don't think this is necessary. In version 3.1.0 all non "JavaBridge" web contexts delegate to JavaBridge to start the FastCGI server once. When it is running, the CGIServlet isn't used anymore, the FastCGI servlet takes over and uses the connection pool to keep the connections to the 20 PHP instances running in the FCGI pool. Unfortunately there are two bugs in the code: 1. the connection pool doesn't handle MAX_REQUESTS correctly (a php instance automatically terminates after some time to avoid memory leaks) and 2. forward itself is working incorrectly in RC1 and RC2. > javax.servlet.ServletException: An IO exception > occured. Probably php was not I think that's the IOException from the pool. The pool has correctly re-opened the connection to the new PHP instance but the exception type is wrong. Since RC3 the pool uses a dedicated exception type to report the death/restart of a FCGI instance to upper layer. > as not > installed as "/usr/bin/php-cgi" or > "c:/php5/php-cgi.exe" > or "/jsmsc/srv/tomcat/webapps/ROOT/WEB-INF/cgi/php-cgi-i386-linux[.sh]| I think this means that you use version 3.1.0 RC1 or RC2. In the official 3.0.8 the message includes "/usr/bin/php". This php location has been dropped because /usr/bin/php may not be CGI or FastCGI binary. > I'd be more than happy. > While I could somehow life with the ssl issue > described in my last email, > this is a killer. After the error occuring it > doesn't work again (so, once Can you please open a ticket and attach the version# of the Bridge and the full stack trace? Regards, Jost Boekemeier ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de |
From: <php...@li...> - 2006-05-31 18:22:34
|
Hi, > some 'real' work with it today. My first move was to > move the php classes > I've used so far into separate files - which didn't > work :| not sure what you mean with this, but if you want to split your files so that each php file exports one php class, this should work. > Fatal error: php_mod_java(88): Protocol violation at > pos 7, please check that > That goes for basically all java_ commands (e.g. > java_context() instead of > java_session()). Thank you very much for the bug report. Which version of the PHP/Java Bridge do you use? Version 3.1.0devel or the official 3.0.8? > Any idea how to solve that? This usually means that the php has received an HTML error message from tomcat instead of the expected XML from the back-end. Or it has received the HTML meta-information but didn't expect them, for example when the php.ini option "java.servlet" is not set but the bridge is actually using a servlet back-end. I think the bridge could somehow catch such an incorrect configuration (java.servlet not set while connected to a servlet or vice versa), but it is difficult to detect because our XML looks similar to the HTML header from the servlet back-end. Pos#7 could mean that a HTML error page was received (<HTML> instead of <Object ...> or <Exception ...>. > To give some further information: I'm running the > bridge inside tomcat on > ubuntu linux with php compiled as fastcgi. Bride Could you please open a ticket (please use http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233) and generate an append the error.log as at the end of the ticket? You can find the tomcat error message at the end of the error.log: strace -s1024 php test.php 2>error.log Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de |