Install PHP4.3.5RC3. dev (Win32) + Apache2.0.52 (ForWin32) and j2sdk1.4 (ForWin32). if it is not installed, read the related manual. In the PHP configuration file php. find "; extension = php_java.dll" in ini, and remove the semicolon to install PHP4.3.5RC3. dev (Win32) Apache 2.0.52 (For Win32) and j2sdk 1.4 (For Win32) are Needless to say. if it is not installed, please refer to the relevant Manual.
In the PHP configuration file php. ini, locate '; extension = php_java.dll' and drop the semicolon;
Find again:
[Java]
; Java. class. path =
; Java. home =
; Java. library =
; Java. library. path =
Changed:
Java. class. path = 'Java's CLASS_PATH; (Directory of the class file to be placed) d: \ java_for_php'
Java. home = 'Java javahome'
Java. library = 'Java JAVAHOME \ jre \ bin \ server \ jvm. dll'
Java. library. path = 'php installation directory \ extensions \'
After modification, the php. ini file must be placed in the Windows installation directory to restart Apache.
Create a new PhpCallJava. java file in d: \ java_for_php with the following content:
Public class PhpCallJava {
Public String testString;
Public String test (String str ){
If (str. equals ('')){
Return 'This is a empty string! ';
} Else {
Return str;
}
}