Copyright notice: Can be reproduced arbitrarily, please be sure to use hyperlinks in the form of the original source of the article and the author's information and this statement
Http://www.5ilinux.com/apache (the most popular Web server platform for UNIX platforms) 02.html
Redhat Linux 9 allows PHP (as the current mainstream development language) to support Java classes
Due to the company's business needs, recently in Linux under the PHP (as the current mainstream development language) Support Java class, so put my debugging notes out, I hope to be useful to everyone.
System environment:
Redhat 9.0
Apache (the most popular Web server platform on UNIX platforms) -1.3.27
MySQL (the best mix with PHP) 3.23-54a-11
PHP (as the current mainstream development language)-4.32
J2sdk1.4.1_03
Installation configuration:
1. MySQL (the best combination with PHP) uses Redhat9 's own RPM package, does not introduce installation, and the JDK installation is simple, we install the JDK to/usr/java/j2sdk1.4.1_03 and set the JDK environment parameters in/etc/profile.
2. Compile and install Apache (the most popular Web server platform for UNIX platforms)
Tar zvxf Apache (the most popular Web server platform for UNIX platforms) _1.3.27.tar.gz
CD Apache (the most popular Web server platform for UNIX platforms) _1.3.27
./configure–prefix=/usr/local/apache (the most popular Web server platform for UNIX platforms) –enable-module=so–enable-shared=max
Make
Make install
3. Compile and install PHP (as the current mainstream development language)
Tar zvxf PHP (as the current mainstream development language) -4.3.2.tar.gz
CD PHP (as the current mainstream development language) -4.3.2
./configure–prefix=/usr/local/php (as the current mainstream development language) –with-mysql (the best combination of PHP collocation)
--with-apxs=/usr/local/apache (the most popular Web server platform for UNIX platforms)/bin/apxs
--with-java=/usr/java/j2sdk1.4.1_03
Make
Make install
Modify/usr/local/apache (the most popular Web server platform for UNIX platforms)/conf/httpd.conf
Find
Add in this range
AddType application/x-httpd-php (as the current mainstream development language). PHP (as the current mainstream development language)
AddType application/x-httpd-php (as the current mainstream development language)-source. PHP (as the current mainstream development language) s
4. Configure PHP (as the current mainstream development language). ini
CP PHP (as the current mainstream development language). ini.dist/usr/local/php (as the current mainstream development language)/lib/php (as the current mainstream development language). ini
Vim PHP (as the current mainstream development language). ini
Modify the following content:
[Java]
Java.class.path =/usr/local/php (as the current mainstream development language)/lib/php (as the current mainstream development language)/php (as the current mainstream development language) _java.jar
Java.home =/usr/java/j2sdk1.4.1_03
Java.library =/usr/java/j2sdk1.4.1_03/jre/lib/i386/libjava.so
Java.library.path =/usr/local/php (as the current mainstream development language)/lib/php (as the current mainstream development language)/extensions/no-debug-non-zts-20020429
Extension_dir =/usr/local/php (as the current mainstream development language)/lib/php (as the current mainstream development language)/extensions/no-debug-non-zts-20020429
Extension=java.so
Save exit.
Cd/usr/local/php (as the current mainstream development language)/lib/php (as the current mainstream development language)/extensions/no-debug-non-zts-20020429
Ln–s java.so libphp (as the current mainstream development language) _java.so This step is very important oh!
Set Environment variables:
Export Ld_library_path=/usr/java/j2sdk1.4.1_03/jre/lib/i386:/usr/java/j2sdk1.4.1_03/jre/lib/i386/server
ok! reboot Apache (the most popular Web server platform on UNIX platforms)
/usr/local/apache (the most popular Web server platform for UNIX platforms)/bin/apache (the most popular Web server platform for UNIX platforms) CTL start
Test, write a test page test.php (as the current mainstream development language)
$system =new Java ("Java.lang.System");
Demonstrate property access (small website favorites)
Print Java version=. $system->getproperty (java.version). ;
?>
The normal words page should be able to display: Java version=1.4.1_03
Author: Zhang Microwave
2003-07-05 in Beijing
http://www.bkjia.com/PHPjc/508688.html www.bkjia.com true http://www.bkjia.com/PHPjc/508688.html techarticle Copyright Notice: Can be reproduced in any way, please be sure to use hyperlinks in the form of the original source of the article and the author information and this statement Http://www.5ilinux.com/apache (Unix platform most popular web services ...