First of all, I did not understand this article when I wrote this article. I just used the example from php.net and tried to do it. It was configured in win2000 apache php4p12. the specific steps are as follows: 1. Install JVM (java virtual machine) (I use jdk122)
Of course, you do not have to use jdk 122 or jdk, but use another one, for example:
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 practices. I have never tried other things. Please do not ask me. Here, please note that, according to the instructions on the official site of php, jdk122 linux is not supported.
Ii. Set Environment Variables
In win2000, choose "my computer"> "properties"> "advanced"> "environment variables"
Set JAVA_HOME
Jdk path. For example, if my jdk122 is installed in e: jspjdk122, set it to e: jspjdk122.
3. Download related files (if you do not have one)
: Http://www.php.net/downloads.php
I downloaded the: 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: jspjdk122in
Extension = php_java.dll
Java. library. path = E: PHP4ext
Java. library = E: Program files‑oftjre1.2inclassicjvm. dll
The above is my configuration. For details, my php4 is in the e: php4 directory, and all my extended dll files are stored in the e: php4ext directory, of course, php_java.dll should be copied to this directory. finally, confirm that your win2000 has jvm. dll file. If not, install visual studio (I installed VC 6, so I don't have to worry about it)
V. Test
Run phpinfo () and you will see "java". If not, it indicates that you have not succeeded. It is shown as follows:
Java
Directive Local Value Master Value
Java. class. path
E: PHP4php_java.jar E: PHP4php_java.jar
Java. home
E: jspjdk122in E: jspjdk122in
Java. library
E: Program files0000oftjre1.2inclassicjvm. dll jvm. dll
Java. library. path
E: PHP4ext no value
Vi. test example
I used the example in the downloaded file: jver. php. If it succeeds, the following results will be displayed:
Java version = 1.2.2
Java vendor = Sun Microsystems Inc.
OS = Windows NT 5.0 on x86
Wednesday, March 13, 2000 at 10:32:53 GMT