我正在使用 Tomcat 6。我已经安装了 PHP,并尝试使用 PHP/JavaBridge 在 Tomcat 中运行 PHP。我已经在 Tomcat 的 webapps 目录中部署了 JavaBridge.war。运行任何 PHP 脚本时,我会在下面收到此错误。请帮助,我感谢您的帮助。
这就是我配置 PHP 的方式:
./configure --with-mime-magic --with-config-file-path=/usr/local/Zend/etc --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml- dir=/usr --with-mhash=/usr/local --with-bz2=/usr --with-curl=/usr --with-gettext=/usr --with-mysql=/usr/local/mysql --with-mcrypt=/usr/local --enable-magic-quotes --enable-bcmath --enable-calendar --enable-ftp --enable-sockets --enable-wddx --enable-mbstring --enable -zip --enable-exif --with-gd=/usr --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd -native-ttf --enable-fastcgi --enable-force-cgi-redirect
来自Tomcat的错误消息如下:
HTTP 状态 500 -
类型异常报告
信息
描述 服务器遇到一个内部错误 () 阻止它完成这个请求。
例外
javax.servlet.ServletException: php.java.bridge.http.FCGIConnectException: 无法连接到服务器 php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:133) org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861) org.apache.coyote.http11 .Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584) java.lang.Thread.run(Thread.java:662) 根原因
php.java.bridge.http.FCGIConnectException: 无法连接到服务器 php.java.bridge.http.SocketChannelFactory.test(SocketChannelFactory.java:58) php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:131 ) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor .java:861) org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584) java.lang .Thread.run(Thread.java:662) 根本原因
java.io.IOException: java.net.ConnectException: 连接被拒绝 php.java.bridge.http.FCGIConnectException.(FCGIConnectException.java:37) php.java.bridge.http.SocketChannelFactory.test(SocketChannelFactory.java:58) php .java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:131) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java :298) org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861) org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) org.apache.tomcat.util.net .AprEndpoint$Worker.run(AprEndpoint.java:1584) java.lang.Thread.run(Thread.java:662) 根本原因
java.io.IOException:未找到 PHP。请安装 php-cgi。PHP 测试命令为: [php-cgi, -v] php.java.bridge.Util$Process.start(Util.java:1145) php.java.servlet.fastcgi.FCGIProcess.start(FCGIProcess.java:68) php .java.bridge.http.SocketChannelFactory.doBind(SocketChannelFactory.java:125) php.java.bridge.http.FCGIConnectionFactory.runFcgi(FCGIConnectionFactory.java:88) php.java.bridge.http.FCGIConnectionFactory$1.run(FCGIConnectionFactory. java:109) 注意 Apache Tomcat/6.0.29 日志中提供了根本原因的完整堆栈跟踪。
Apache Tomcat/6.0.29