PHP and Java integrated development detailed analysis powerful Union 1th 4 page _php skill

Source: Internet
Author: User
Tags install php php script
As time went by, the two bright spots grew brighter, and soon they were loved by programmers, and there was a question: what would happen if they met? Is it possible to combine their strengths?

Trying to build a bridge between PHP and Java, using this bridge to build a communication channel between the two entities, with the help of this bridge, you can develop classes in Java and then call them in PHP, as well, PHP scripts can also be used in your Java desktop or Web application.

In this article, you will learn how to:

Installing and configuring the Php/java Bridge

Using Java classes in PHP scripts

Using PHP scripts in Java classes

Using PHP scripts in JSP pages

Then let's get started!

Installing and configuring the Php/java Bridge

The latest Php/java Bridge Zip package can be downloaded to the, and the installation process relies on which Java platform is selected to interact with the PHP script through this bridge.

For J2SE, the installation is very simple:

Install J2SE 1.6 or later

Install PHP 5.1.4 or later

Extract Package

From the command prompt into the newly unpacked directory, enter:

>java? classpath Javabridge.war testinstallation

In this folder, you should see an ext directory, which includes four. jar files, copy the Javabridge.jar and Php-script.jar to your J2SE installation directory in the Ext folder (usually {java_home}/jre/ Lib/ext).

For Java EE, perform the following installation steps:

Copy the Javabridge.war file to the Auto_deploy folder under your Java EE server or servlet engine (tomcat,resin, etc.).

Rename the file according to your application, and then restart the Java server, waiting for the automated deployment process to create a directory related to the. war file, in this case the application is called Appname.war.

Test the new application from the browser, enter: Http://localhost:8080/appName, then click test.php.

If your Java EE server is running on different hosts and ports well, the parameters should be modified accordingly.

Note: If you want to run the j2ee/php application on Apache or IIS, copy the directory including appname to the Apache/iis document root directory.
Current 1/4 page 1234 Next read the full text

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.