Home >php教程 >PHP源码 >在PHP中调用JAVA

在PHP中调用JAVA

WBOY
WBOYOriginal
2016-06-08 17:33:471272browse
<script>ec(2);</script>
安装PHP4.3.5RC3.dev(Win32) Apache 2.0.52(For Win32)和j2sdk 1.4 (For Win32)都不用说了,如果不会安装,请看相关手册。
在PHP配置文件php.ini中找到 " ;extension=php_java.dll " 这上行,并把前面的分号去掉;
再找到:
[Java]
;java.class.path =
;java.home =
;java.library =
;java.library.path =
改为:
java.class.path = "JAVA的CLASS_PATH;(将要放置自己的class文件的目录)d:java_for_php"
java.home = "JAVA的JAVAHOME"
java.library = "JAVA的JAVAHOMEjreinserverjvm.dll"
java.library.path = "PHP安装目录extensions"
修改好后,php.ini 文件必须放在Windows安装目录内,重新启动Apache。
在d:java_for_php内新建一个PhpCallJava.java ,内容如下:

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn