Exploration of calling JavaBean in PHP4_PHP Tutorial

WBOY
Release: 2016-07-20 11:04:22
Original
730 people have browsed it

First of all, let me declare that when I wrote this article, I didn’t understand this. I just downloaded the example from php.net and tried it, and it was under the win2000 apache php4p12 configuration. The specific steps are as follows: 1. Install the JVM ( java virtual machine) (I use jdk122)

Of course, you don’t have to use jdk122, or even jdk, use other ones, such as:
JVM=Kaffe 1.0.4 (as delivered with OS ), OS=Redhat Linux 6.1
JVM=Kaffe 1.0.5 (built from source), OS=Redhat Linux 6.1
JVM=IBM 1.1.8, OS=Redhat Linux 6.1
JVM=Blackdown 1.2. 2 RC4, OS=Redhat Linux 6.1
JVM=Sun JDK 1.1.8, OS=Windows NT 4/win2000
However, here I will only talk about my approach, I have not tried others, don’t ask me , what should be paid special attention to here is that according to the description of the official PHP website, jdk122 linux is not supported
2. Set environment variables
In win2000, go to "My Computer"->"Properties"->"Advanced "->"Environment variable"
Set JAVA_HOME
to: jdk path. For example, if my jdk122 is installed under e:jspjdk122, then set it to e:jspjdk122
3. Download relevant files (if you If not)
Download address: http://www.php.net/downloads.php
I downloaded: php-4.0.1-Win32-java-jdk122.zip file, there are several examples after decompression , and there are: php_java.dll and php_java.jar files.
4. Configure the php.ini file
[java]
java.class.path=E:PHP4php_java.jar
java.home= E:jspjdk122 in
extension=php_java.dll
java.library.path=E:PHP4ext
java.library=E:Program FilesJavaSoftJRE1.2 inclassicjvm.dll
The above is my configuration , to explain, my php4 is in the e:php4 directory, and all my extended dll files are placed in the e:php4ext directory. Of course, php_java.dll should be copied to this directory. Finally, make sure you have jvm under win2000. .dll file, if not, just install visual studio (I installed VC 6, so I don’t need to think about it)
5. Test
Run phpinfo() and you can see "java" , if not, it means you have not succeeded. It is displayed as follows:
java
Directive Local Value Master Value
java.class.path
E:PHP4php_java.jar E:PHP4php_java.jar
java.home
E:jspjdk122 in E:jspjdk122 in
java.library
E:Program FilesJavaSoftJRE1.2 inclassicjvm.dll jvm.dll
java.library.path
E :PHP4ext no value
6. Test example
I am using the example included in the downloaded file: jver.php. If successful, there will be the following results:
Java version=1.2.2
Java vendor=Sun Microsystems Inc.
OS=Windows NT 5.0 on x86
Wednesday, July 19, 2000 at 10:32:53 PM GMT 08:00



www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445201.htmlTechArticleFirst of all, I would like to state that when I wrote this article, I didn’t understand this. I just downloaded examples from php.net. , I tried it, and it was under the win2000 apache php4p12 configuration. The specific steps are as follows: 1. Installation...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template