Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-11-2009
Member
 
Join Date: May 2009
Posts: 3,613
Problem calling JAVA with PHP5

I have problem with my JAVA call in my PHP page. Here is my PHP test page index.php
PHP Code:
<?php
require_once("java/Java.inc" );
$system = new Java("java.lang.System" );
print 
"Java version=".$system->getProperty("java.version" )." <br>\n";
?>
Here is the error received after 30 seconds
Quote:
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 beyond a certain time or established connection failed because connected host has not responded. ) in C:\Inetpub\wwwroot\testphp\java\Java.inc on line 922

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Inetpub\wwwroot\testphp\java\Java.inc on line 922
It seems to point to the 8080 ...

- I am using IIS port 80
- I also configured the "java.port" in "php.ini" to "localhost" ...
Reply With Quote
  #2  
Old 14-11-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Problem calling JAVA with PHP5

1) What is the lib that you have used to call your java?
2) Is the code of your lib trying to reach something on port 8080, which is supposed to do your thing?
3) java.port should contain a port number by a machine name, I'd say ...
Reply With Quote
  #3  
Old 14-11-2009
Member
 
Join Date: May 2009
Posts: 3,613
Re: Problem calling JAVA with PHP5

1st thing, it is the "Java.host" instead of "java.port", I set to "localhost" (oops)

then (of PHP 5)
I use "Javabridge" as a library because I just could with "php-java"

purpose (for now) is to test the JAVA in PHP

for the final call on reports iReport(jasper)
(Not easy ....)
Reply With Quote
  #4  
Old 14-11-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Problem calling JAVA with PHP5

I feel that this is not what you seek, your Javabridge ... you've followed the instructions to install? must install a tomcat ... which listens by default on port 8080, indeed ...

These are some of the key tomcat directories:
  • /bin - Startup, shutdown, and other scripts. The *.sh files (for Unix systems) are functional duplicates of the *.bat files (for Windows systems). Since the Win32 command-line lacks certain functionality, there are some additional files in here.
  • /conf - Configuration files and related DTDs. The most important file in here is server.xml. It is the main configuration file for the container.
  • /logs - Log files are here by default.
  • /webapps - This is where your webapps go.
Reply With Quote
  #5  
Old 14-11-2009
Member
 
Join Date: May 2009
Posts: 3,613
Re: Problem calling JAVA with PHP5

In fact, I have not installed the "Apache Tomcat"! I have read in php5 that we should no longer use the "javadridge.jar"! But with the "phpinfo" I can never have the java part. What must be installed for IIS? On another server, we test the same thing with installing EasyPHP (ie a apache server)

Is this server that acts as a server "Apache Tomcat"?
Reply With Quote
  #6  
Old 14-11-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Problem calling JAVA with PHP5

Quote:
Originally Posted by Wyvern View Post
In fact, I have not installed the "Apache Tomcat"! I have read in php5 that we should no longer use the "javadridge.jar"! But with the "phpinfo" I can never have the java part. What must be installed for IIS?
Tomcat is a project of the Apache Foundation.
Quote:
Originally Posted by Wyvern View Post
On another server, we test the same thing with installing EasyPHP (ie a apache server)

Is this server that acts as a server "Apache Tomcat"?
nothing to see.

Tomcat is a java application server, its going to run your Java code if I followed.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem calling JAVA with PHP5"
Thread Thread Starter Forum Replies Last Post
blackberry 9500 calling problem Odyysseus Portable Devices 6 06-10-2010 10:26 PM
Sony Ericsson Xperia X10 Mini calling problem. Iopeter Portable Devices 5 29-09-2010 03:50 PM
Video calling Problem in Nokia E63 WaseemA Portable Devices 4 04-09-2010 11:40 AM
Problem when calling a Javascript function Truster Software Development 5 21-07-2010 11:37 PM
calling out all tech gurus ...very complex problem abhishek_turbo911 Windows Software 7 19-07-2009 07:10 AM


All times are GMT +5.5. The time now is 11:16 AM.