From: <php...@li...> - 2009-03-06 14:25:20
|
Hi, I am trying to use the bridge to run PHP5 under Tomcat on Windows XP. I have started with the JavaBridge.war in webapps, and I can run http://localhost:8080/JavaBridge/test.php fine. I was having trouble loading the MySQL extension, and thought it was a problem with communications to MySQL. But, I have finally figured out that I can't load any PHP extensions at all, so I'll stick to mentioning php_bz2.dll. In the Windows path, C:\PHP is included. The versions I have: Tomcat-6.0.18 PHP-5.2.6 JavaBridge-5.4.3.3 JDK-1.6.0_12 I have tried setting the registry to use C:\PHP\php.ini since my command-line php executable loads the .ini and extensions, but it made no difference under JavaBridge. For now, I am using WEB-INF\cgi\php.ini, as confirmed by the output from test.php. From the default php.ini that came with JavaBridge.war, all I have done is change the following: extensions="C:\PHP\ext\" extension=php_bz2.dll and I get (if I restore those two lines, restart Tomcat, and access test.php, everything works): HTTP Status 500 - ------------------------------ *type* Exception report *message* *description* *The server encountered an internal error () that prevented it from fulfilling this request.* *exception* javax.servlet.ServletException: PHP FastCGI instance failed. php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:395) php.java.servlet.CGIServlet.handle(CGIServlet.java:401) php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) *root cause* php.java.servlet.fastcgi.ConnectionException php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:55) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) php.java.servlet.CGIServlet.handle(CGIServlet.java:401) php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) *root cause* java.io.IOException: Protocol error php.java.servlet.fastcgi.FastCGIInputStream.doRead(FastCGIInputStream.java:64) php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:51) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) php.java.servlet.CGIServlet.handle(CGIServlet.java:401) php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) *note* *The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.* In the Tomcat logs, I get: Mar 6, 2009 8:19:29 AM org.apache.catalina.core.ApplicationContext log INFO: PHP application terminated unexpectedly, have you started php-cgi with the environment setting PHP_FCGI_MAX_REQUESTS=5000? Error: php.java.servlet.fastcgi.ConnectionException Mar 6, 2009 8:19:29 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet PhpCGIServlet threw exception java.io.IOException: Protocol error at php.java.servlet.fastcgi.FastCGIInputStream.doRead(FastCGIInputStream.java:64) at php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:51) at php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) at php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) at php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) at php.java.servlet.CGIServlet.handle(CGIServlet.java:401) at php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) at php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) I have set the PHP_FCGI_MAX_REQUESTS env. var., but made no difference. What am I doing wrong? Thanks in advance, Shash |
From: <php...@li...> - 2009-03-06 16:22:08
|
BTW, I wanted to mention, I have already tried some of the possible solutions I have found on the mailing-list archives here. - I have unset PHPRC and removed C:\PHP from windows Path, restarted Tomcat - no effect - I have changed prefer_system_php_exec to Off in web.xml, restarted Tomcat - no effect - C:\PHP\php-cgi -i does not crash On Fri, Mar 6, 2009 at 8:25 AM, Sasvata Chatterjee < sas...@gm...> wrote: > Hi, > > I am trying to use the bridge to run PHP5 under Tomcat on Windows XP. I > have started with the JavaBridge.war in webapps, and I can run > http://localhost:8080/JavaBridge/test.php fine. I was having trouble > loading the MySQL extension, and thought it was a problem with > communications to MySQL. But, I have finally figured out that I can't load > any PHP extensions at all, so I'll stick to mentioning php_bz2.dll. In the > Windows path, C:\PHP is included. > > The versions I have: > Tomcat-6.0.18 > PHP-5.2.6 > JavaBridge-5.4.3.3 > JDK-1.6.0_12 > > I have tried setting the registry to use C:\PHP\php.ini since my > command-line php executable loads the .ini and extensions, but it made no > difference under JavaBridge. For now, I am using WEB-INF\cgi\php.ini, as > confirmed by the output from test.php. From the default php.ini that came > with JavaBridge.war, all I have done is change the following: > > extensions="C:\PHP\ext\" > extension=php_bz2.dll > > and I get (if I restore those two lines, restart Tomcat, and access > test.php, everything works): > HTTP Status 500 - > ------------------------------ > > *type* Exception report > > *message* > > *description* *The server encountered an internal error () that prevented > it from fulfilling this request.* > > *exception* > > javax.servlet.ServletException: PHP FastCGI instance failed. > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:395) > php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > > php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > *root cause* > > php.java.servlet.fastcgi.ConnectionException > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:55) > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) > php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > > php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > *root cause* > > java.io.IOException: Protocol error > php.java.servlet.fastcgi.FastCGIInputStream.doRead(FastCGIInputStream.java:64) > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:51) > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) > > php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > *note* *The full stack trace of the root cause is available in the Apache > Tomcat/6.0.18 logs.* > In the Tomcat logs, I get: > > Mar 6, 2009 8:19:29 AM org.apache.catalina.core.ApplicationContext log > INFO: PHP application terminated unexpectedly, have you started php-cgi > with the environment setting PHP_FCGI_MAX_REQUESTS=5000? Error: > php.java.servlet.fastcgi.ConnectionException > Mar 6, 2009 8:19:29 AM org.apache.catalina.core.StandardWrapperValve invoke > SEVERE: Servlet.service() for servlet PhpCGIServlet threw exception > java.io.IOException: Protocol error > at > php.java.servlet.fastcgi.FastCGIInputStream.doRead(FastCGIInputStream.java:64) > at > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:51) > at > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) > at > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) > at > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) > at php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > at php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > at php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) > at > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) > at java.lang.Thread.run(Unknown Source) > > I have set the PHP_FCGI_MAX_REQUESTS env. var., but made no difference. > > What am I doing wrong? Thanks in advance, > > Shash > |
From: <php...@li...> - 2009-03-06 16:33:56
|
If you can't load any php-extensions this is not a problem with the php java bridge. first try to figure that one out.. probably there are some problems with your path. next, have you looked at the stack trace, especially the "have you started php-cgi with the environment setting PHP_FCGI_MAX_REQUESTS=5000? " part? have you set the environment variable? the php-java bridge works by invoking either a servlet on the java server side if you want to use java from within php or certain php-scripts on the php server side if you want to use php from within java. it looks like you want to use php from within java, but the php-process on the server side died (or you have not started the php-webserver) and because of this you get the connection-error/IOException.. regards, dominik 2009/3/6 <php...@li...> > BTW, I wanted to mention, I have already tried some of the possible > solutions I have found on the mailing-list archives here. > > - I have unset PHPRC and removed C:\PHP from windows Path, restarted Tomcat > - no effect > - I have changed prefer_system_php_exec to Off in web.xml, restarted Tomcat > - no effect > - C:\PHP\php-cgi -i does not crash > > On Fri, Mar 6, 2009 at 8:25 AM, Sasvata Chatterjee < > sas...@gm...> wrote: > > > Hi, > > > > I am trying to use the bridge to run PHP5 under Tomcat on Windows XP. I > > have started with the JavaBridge.war in webapps, and I can run > > http://localhost:8080/JavaBridge/test.php fine. I was having trouble > > loading the MySQL extension, and thought it was a problem with > > communications to MySQL. But, I have finally figured out that I can't > load > > any PHP extensions at all, so I'll stick to mentioning php_bz2.dll. In > the > > Windows path, C:\PHP is included. > > > > The versions I have: > > Tomcat-6.0.18 > > PHP-5.2.6 > > JavaBridge-5.4.3.3 > > JDK-1.6.0_12 > > > > I have tried setting the registry to use C:\PHP\php.ini since my > > command-line php executable loads the .ini and extensions, but it made no > > difference under JavaBridge. For now, I am using WEB-INF\cgi\php.ini, as > > confirmed by the output from test.php. From the default php.ini that came > > with JavaBridge.war, all I have done is change the following: > > > > extensions="C:\PHP\ext\" > > extension=php_bz2.dll > > > > and I get (if I restore those two lines, restart Tomcat, and access > > test.php, everything works): > > HTTP Status 500 - > > ------------------------------ > > > > *type* Exception report > > > > *message* > > > > *description* *The server encountered an internal error () that prevented > > it from fulfilling this request.* > > > > *exception* > > > > javax.servlet.ServletException: PHP FastCGI instance failed. > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:395) > > php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > > > > php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > > php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > > > *root cause* > > > > php.java.servlet.fastcgi.ConnectionException > > > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:55) > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) > > > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) > > php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > > > > php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > > php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > > > *root cause* > > > > java.io.IOException: Protocol error > > > php.java.servlet.fastcgi.FastCGIInputStream.doRead(FastCGIInputStream.java:64) > > > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:51) > > > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) > > > > php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > > php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > > php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > > > *note* *The full stack trace of the root cause is available in the Apache > > Tomcat/6.0.18 logs.* > > In the Tomcat logs, I get: > > > > Mar 6, 2009 8:19:29 AM org.apache.catalina.core.ApplicationContext log > > INFO: PHP application terminated unexpectedly, have you started php-cgi > > with the environment setting PHP_FCGI_MAX_REQUESTS=5000? Error: > > php.java.servlet.fastcgi.ConnectionException > > Mar 6, 2009 8:19:29 AM org.apache.catalina.core.StandardWrapperValve > invoke > > SEVERE: Servlet.service() for servlet PhpCGIServlet threw exception > > java.io.IOException: Protocol error > > at > > > php.java.servlet.fastcgi.FastCGIInputStream.doRead(FastCGIInputStream.java:64) > > at > > > php.java.servlet.fastcgi.FastCGIInputStream.read(FastCGIInputStream.java:51) > > at > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.parseBody(FastCGIServlet.java:451) > > at > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.doExecute(FastCGIServlet.java:374) > > at > > > php.java.servlet.fastcgi.FastCGIServlet$CGIRunner.execute(FastCGIServlet.java:382) > > at php.java.servlet.CGIServlet.handle(CGIServlet.java:401) > > at php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:350) > > at php.java.servlet.CGIServlet.doGet(CGIServlet.java:471) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > > at > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > > at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) > > at > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > > at > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > > at > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) > > at > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) > > at > > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) > > at > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) > > at java.lang.Thread.run(Unknown Source) > > > > I have set the PHP_FCGI_MAX_REQUESTS env. var., but made no difference. > > > > What am I doing wrong? Thanks in advance, > > > > Shash > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |