Thursday 28 June 2012

PHP-Java Bridge

Installing the Bridge

For a basic setup, it is easiest to deploy the PHP-Java Bridge with a standalone backend.

Linux

  • The standalone Bridge can be installed with rpm.
$ rpm -i php-java-bridge-standalone-3.0.7-1.noarch.rpm 
 

Windows

  • Extract the JavaBridge archive, and then extract JavaBridge.war.
  • Copy WEB-INF/lib to your PHP extensions directory (e.g. c:\php\ext) and then copy WEB-INF/cgi/java-x86-windows.dll to your PHP extensions directory. (Note that even though we're using PHP 5, we're NOT using the alternative php-5.0-java-x86-windows.dll!)
  • Rename the dll to php_java.dll     

    Configuring PHP to run the Bridge

    []

    Linux

    Find your php.ini file and open it in a text editor. Add the following lines, using appropriate directory names as apply to you.
    extension_dir = "/usr/lib/php/modules"
    
    extension=java.so
    
    [java]
    java.java_home = "/usr/java/jdk1.5.0_06"
    java.java      = "/usr/java/jdk1.5.0_06/bin/java"
    java.log_level = 2
    java.log_file  = "/var/www/log/java-bridge.log"
    
    Restart Apache to load the new PHP configuration.
    []

    Windows

    Find your php.ini file and open it in a text editor. Add the following lines, using appropriate directory names as apply to you.
    extension_dir = "C:\php\ext"
    
    extension=php_java.dll
    
    [java]
    java.java        = "C:\Program Files\Java\jdk1.5.0_08\jre\bin\javaw"
    java.java_home   = "C:\Program Files\Java\jdk1.5.0_08"
    java.log_level = 2
    java.log_file  = "C:\php\log\java-bridge.log"
    
    Restart Apache to load the new PHP configuration.
    []

    Confirming Your Installation

    Open phpinfo.php (included with the UI) in your browser. You should find a "java" section which notes that "java support" is "enabled" and that "java status" is "running".
 

4 comments:

  1. Can you please inform where can we get java-x86-windows.dll file?

    ReplyDelete
  2. i am looking for java-x86-windows.dll file. Can some one please tell me where to download? Or can you please mail me the file to cloudenvision@gmail.com
    This is regarding using php_java_bridge for integrating a php application with a Java application

    Thanks
    Arun

    ReplyDelete
  3. Can anyone please share this java-x86-windows.dll for php_java_bridge.. mbilalhashmi@gmail.com

    ReplyDelete
  4. Thanks for sharing the important points of view with us. It is really very nice blog which describes how to icici payment gateway plugin

    ReplyDelete

Note: only a member of this blog may post a comment.