Results 1 to 6 of 6

Thread: Problem calling JAVA with PHP5

  1. #1
    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
    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" ...

  2. #2
    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 ...

  3. #3
    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 ....)

  4. #4
    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.

  5. #5
    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"?

  6. #6
    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.

Similar Threads

  1. blackberry 9500 calling problem
    By Odyysseus in forum Portable Devices
    Replies: 6
    Last Post: 06-10-2010, 10:26 PM
  2. Sony Ericsson Xperia X10 Mini calling problem.
    By Iopeter in forum Portable Devices
    Replies: 5
    Last Post: 29-09-2010, 03:50 PM
  3. Video calling Problem in Nokia E63
    By WaseemA in forum Portable Devices
    Replies: 4
    Last Post: 04-09-2010, 11:40 AM
  4. Problem when calling a Javascript function
    By Truster in forum Software Development
    Replies: 5
    Last Post: 21-07-2010, 11:37 PM
  5. calling out all tech gurus ...very complex problem
    By abhishek_turbo911 in forum Windows Software
    Replies: 7
    Last Post: 19-07-2009, 07:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,328,596.76889 seconds with 16 queries