Example () and concrete configuration (transfer) for PHP4 call JavaBean ()

zhaozj2021-02-12  149

Example () and concrete configuration (transfer) for PHP4 call JavaBean ()

First of all, when writing this article, I don't understand this, but I have undergone example from php.net, try to do it, and are configured in Win2000 Apache PHP4P12. And, I have never encountered two Specific and need to solve problems

(1) I don't know how to call Javabean I wrote.

(2) IIS WIN2000 PHP4P12 has not successful

Please understand the predecessors of the above questions, will be grateful!

First, install JVM (Java Virtual Machine) (I use JDK122)

Of course, you don't have to use JDK122, not even JDK, with other, 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 only speak my approach, I haven't tried it, don't ask me, I should pay special attention to the official website of the PHP, I don't support JDK122 Linux.

Second, set environment variables

"My Computer" in Win2000 -> "Properties" -> "Advanced" -> Environment Variables

Set java_home

For: JDK path, such as my JDK122 is installed in E: JSPJDK122, then set to E: jspjdk122

Third, download related documents (if you have no,

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.

Fourth, 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 Filesjavasoftjre1.2Inclassicjvm.dll

The above is my configuration, explain, my php4 is in the E: PHP4 directory, all of my extended DLL files are placed in the E: php4ext directory, of course, PHP_JAVA.DLL should copy to this directory. Finally confirm you There is a jvm.dll file in Win2000, if not, install Visual Studio (I installed a VC 6, so I don't have to consider)

V. Test

If you run PHPINFO (), you can see "Java", if not, you don't succeed. Its display is 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 Filesjavasoftjre1.2Inclassicjvm.dll Jvm.dll

Java.library.path

E: PHP4ext No Value

Sixth, test example

I am using the examples contained in the downloaded file: jver.php, if success, 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 afternoon GMT 08: 00

Seven, again

In fact, here, I still have a lot of problems that have not been solved. If you know, if you can give me a prompt and pointing, I will grate!

转载请注明原文地址:https://www.9cbs.com/read-6405.html

New Post(0)