PHP and Java integrated Development analysis of the powerful joint 1th/4 page _php Tutorial

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

Try 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 invoke their methods in PHP, as well, You can also use PHP scripts 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

So let's get started!

Installing and configuring the Php/java Bridge

The latest Php/java Bridge ZIP package is available for download in http://sourceforge.net/projects/php-java-bridge/, and the installation process relies on choosing which Java platform to interact with the PHP script through the bridge.

For J2SE, installation is simple:

Installing J2SE 1.6 or later

Install PHP 5.1.4 or later

Unzip the Php-java-bridge_5.2.2_j2ee.zip bag

From the command prompt, enter the directory you just unzipped, and enter:

>java? classpath Javabridge.war testinstallation

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

For the Java EE, perform the following installation steps:

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

Rename the file according to your application, then restart the Java EE Server and wait for the automatic deployment process to create the directory associated with the. war file, in this case the application is called Appname.war.

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

If your Java EE server is running on a different host and port, the parameters should be modified accordingly.

Note: If you want to run the j2ee/php application on Apache or IIS, copy the directory that includes the appname to the Apache/iis document root directory.

http://www.bkjia.com/PHPjc/319584.html www.bkjia.com true http://www.bkjia.com/PHPjc/319584.html techarticle As time went by, the two bright spots became brighter, and soon they were liked by programmers, so there was a question: what would happen if they met ?

  • Related Article

    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: info-contact@alibabacloud.com 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.