HTTP状态500 - PHP FastCGI实例失败

时间:2015-03-02 10:37:56

标签: java php tomcat

我已将JavaBridge添加到apache-tomcat / webapps / 当我尝试在浏览器中打开JavaBridge(localhost:8080/JavaBridge)时,我得到了

HTTP Status 500 - PHP FastCGI instance failed. 

没有它,我认为c / p JavaBridge.jar,php-script.jar和php-servlet.jar,创建test.php是没用的。
我该如何解决这个问题?

我在 JasperReports Server 6.0.1上使用 tomcat v7

错误的其余部分:

type Exception report

message PHP FastCGI instance failed.

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.execute(FastCGIServlet.java:448)
    php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
    php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)


root cause 

php.java.bridge.http.FCGIConnectionException
    php.java.bridge.http.FCGIInputStream.read(FCGIInputStream.java:58)
    php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:362)
    php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
    php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
    php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)


root cause 

java.io.IOException: Protocol error
    php.java.bridge.http.FCGIInputStream.doRead(FCGIInputStream.java:67)
    php.java.bridge.http.FCGIInputStream.read(FCGIInputStream.java:54)
    php.java.servlet.fastcgi.FastCGIServlet.parseBody(FastCGIServlet.java:362)
    php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:433)
    php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:481)
    php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.

1 个答案:

答案 0 :(得分:0)

将文件从C:/PHP复制到C:/Program Files/PHP

JavaBridge.war有错误的php-cgi二进制文件,并使用php.ini cgi目录。它必须安装在C:/Program Files/PHP 中(C:/ PHP不起作用,除非在web.xml中以某种方式更改了init-parmas)

检查这2个问题。

1)Windows安装要求php.ini在C:\WINDOWS,除非您使用 以下注册表项将其放在其他位置: HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath

2)只是为了完整性,而不是JavaBridge问题:不要使用PHP安装程序 对于Windows,并不提供一切。而是得到二进制文件 分发并手动解压缩到C:/Program Files/PHP,将C:/Program Files/PHP添加到Windows路径中,添加PHPRC=C:/Program Files/PHP env var。修改 php.ini要更改extensions_dir=C:/Program Files/PHP/ext