Search code examples
php-java-bridge

Why does JavaBridge work but JavaBridgeTemplate621 not


I am trying to install a PHP Java Bridge as per the instructions on http://php-java-bridge.sourceforge.net/pjb/index.php on Windows 7

I have PHP working fine on via IIS installed at c:\php

I copied the JavaBridge.war to c:\php which proved to get a good result from the test (running from c:\php)

java -classpath JavaBridge.war TestInstallation

I installed Tomcat 7 and copied the JavaBridge.war to webapps, which the service extract automatically and I am able to get the expected result from

http://localhost:8080/JavaBridge/

All Ok Great!

However when I do the same with the JavaBrigdeTemplate621.war, the browser

http://localhost:8080/JavaBridgeTemplate621/

returns an error

HTTP Status 500 - php.java.bridge.http.FCGIConnectException: Could not connect to server

I have not included the whole page as its very verbose, but the last root cause entry is

root cause

java.io.IOException: PHP not found. Please install php-cgi. PHP test command was: [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.NPChannelFactory.doBind(NPChannelFactory.java:94) php.java.bridge.http.FCGIConnectionFactory.runFcgi(FCGIConnectionFactory.java:88) php.java.bridge.http.FCGIConnectionFactory$1.run(FCGIConnectionFactory.java:109)

I've tried restarting IIS as well as Tomcat several times

What am I missing (It's Hot and it's Friday ....)

I notice that

\webapps\JavaBridgeTemplate621\WEB-INF\cgi\x86-windows

has a text file called php-cgi.exe.MISSING.README.txt

where as

\webapps\JavaBridge\WEB-INF\cgi\x86-windows

has php-cgi.exe, php5ts.dll and php.ini

Is there another manual step required to get those in there not documented in the instructions?


Solution

  • Not reading the instructions clearly enough. I missed that you should copy the automatically created folder (from war) into the IIS web apps folder. I was trying use Tomcat as the HTTP server instead of IIS. Once I copied them to IIS and accessed via default port 80 (not 8080) it worked fine.

    Hope my conversation with myself is of benefit to someone else