Zend Server User Guide > Concepts > Java Bridge

Java Bridge

The Zend Java Bridge provides PHP developers with a way to use existing Java code and build PHP applications that use Java code.The Java Bridge integrates Java code in PHP by connecting the PHP object system with the Java Bridge object system.

Note:

The Java Bridge requires that you have Oracle's JRE 1.5 (or later) or IBM's Java 1.5 (or later) installed on your computer. During (or after) installing (depending on the installation type), you are prompted to direct the installer to the JRE location. You should, therefore, already have JRE installed. More information about JRE and the latest updates can be obtained from www.java.com.

The Java Bridge PHP extension adds functions that allow you to instantiate new Java classes from inside your PHP script. Once a Java class is instantiated, the Java Bridge gets a message from the Zend Engine to execute the Java code. The Java Bridge executes the script and returns the results to the Zend Engine.

Zend Server for IBMi includes the Java Bridge PHP Extension and the ability to restart the Java Bridge and configure the Java Bridge settings ( Configurations | Components).

The Java Bridge is an optional component that is installed differently, depending on the operating system (WIN, UNIX) and the installation method format (EXE, DEB, RPM). Once the extension is installed and its status is On, PHP code can use the Java Bridge API to call Java objects.

 

The process of calling Java objects in PHP is described in the following diagram:

Advantages

The Zend Java Bridge provides the following advantages:

 

Read Also

  Working with the Java Bridge    
  Zend Java Bridge - Configuration Directives    
  Zend Java Bridge - PHP API    
  Java Bridge Use Cases