Mark Nold
Joost Soeterbroek
The Java extension is an extremely exciting tool. By learning how to use this module, you can extend PHP by the power of all available Java classes. To show your basics of the Java extension, this article would cover installation and a few code examples of using PHP an D Java together.
Windows Installation
The following configuration has been tested with Apache 1.3.12, PHP 4.0.3 binaries from www.php4win.de plus the 4.0.3 Zend Optimiser and JDK 1.2.2 from java.sun.com. We have also tested this configuration with older versions of the JDK and the various MS webservers (PWS and IIS) on Windo WS-98, Windows, and NT4.
Step 1:install the JDK. This was fairly simple, as the JDK installs without many questions. It might is useful to check your environment (Autoexec.bat in Windows 9x and System under Control Panel in NT) and make Su Re the Jdk1.x.xin directory is in your path. This would make compiling your Java Classes easier. On Win9x add
path=%path%; c:jdk1.2.2in
to your Autoexec.bat. On NT add
; c:jdk1.2.2in
To the end of the PATH environment variable. It is also important to note in your Autoexec.bat file, the PHP Java extension
ignoresThe Java_home and CLASSPATH set up in the environment. This is important because these items must are set correctly in your php.ini file for the Java extension to work.
Step 2:modifying your php.ini. You need to add something similiar to your php.ini file
[Java]
Extension=php_java.dll
Java.library.path=c:webphp4extensionsjava.class.path= "C:webphp4extensionsjdk1.2.2php_java.jar;c:myclasses"
http://www.bkjia.com/PHPjc/630288.html www.bkjia.com true http://www.bkjia.com/PHPjc/630288.html techarticle Mark nold Joost soeterbroek The Java extension is an extremely exciting tool. By learning how to use this module, you can extend PHP by the power of all available Java classes. to S ...