• 技术文章 >php教程 >php手册

    PHP&Java(1)

    2016-06-13 11:20:42原创356
    Mark Nold
    Joost Soeterbroek

    The Java extension is an extremely exciting tool. By learning how to use this module, you can extend PHP by the power of all available Java classes. To show you the basics of the Java extension, this article will cover installation and a few code examples of using PHP and Java together.

    Windows Installation


    The following configuration has been tested with Apache 1.3.12, PHP 4.0.3 binaries from www.php4win.de plus the 4.0.3 Zend Optimiser and JDK 1.2.2 from java.sun.com. We have also tested this configuration with older versions of the JDK and the various MS webservers (PWS and IIS) on Windows 95, Windows 98 and NT4.
    Step 1: Install the JDK. This is fairly simple, as the JDK installs without many questions. It might be useful to check your environment (autoexec.bat in Windows 9x and System under Control Panel in NT) and make sure the jdk1.x.xin directory is in your path. This will make compiling your Java Classes easier. On Win9x add
    PATH=%PATH%;C:jdk1.2.2in

    to your autoexec.bat. On NT add
    ;C:jdk1.2.2in

    to the end of the PATH environment variable. It is also important to note in your autoexec.bat file, the PHP Java extension ignores the JAVA_HOME and CLASSPATH set up in the environment. This is important because these items must be set correctly in your php.ini file for the Java extension to work.
    Step 2: Modifying your php.ini. You need to add something similiar to your php.ini file

    [java]
    extension=php_java.dll
    java.library.path=c:webphp4extensionsjava.class.path="c:webphp4extensionsjdk1.2.2php_java.jar;c:myclasses"
    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    上一篇:谈汉字转换类型及解决方案 下一篇:正则表达式例子:php中检查email完整性
    php培训_php实战培训【立即报名】-php中文网第20期

    相关文章推荐

    • 【活动】充值PHP中文网VIP即送云服务器• PHP更新购物车数量(表单部分/PHP处理部分)• PHP Array交叉表实现代码• 继续收藏一些PHP常用函数第1/2页• PHP常用代码• Windows下搭建PHP开发环境
    1/1

    PHP中文网