I downloaded php-java-bridge and copied Java classes (in PHP files) from the package. I omitted the JavaBridge.war, JavaBridge.jar, and php_java.dll, because I only want to run it using pure PHP classes (as noted in the documentation).
And I created a file (testJava.php) to test the Java calling function. The script is below:
$string = new Java("java.lang.String", "HelloWorld");
Where Java.php contains Java class declaration, etc.
After I run it on http://localhost/testJava.php
, I found the following error message:
"Warning: fsockopen() [function.fsockopen]: unable to connect to 127.0.0.1:8080 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\root\java\Protocol.php on line 269
Could not connect to the J2EE server.
Please start it, for example with the command: "java -Dphp.java.bridge.default_
ous=true -classpath JavaBridge.jar php.java.bridge.JavaBridge
Error message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)"
So, it mentioned that it could not connect to J2EE server and was unable to connect to 127.0.0.1:8080.
Any idea of why this is happening? Do I need to setup the J2EE server somewhere? (Btw I have JRE installed)
Any other ideas are appreciated.