This paper introduces the establishment of the development environment of the melting JSP, PHP and Java in a stove, in order to suit the needs of the most beginners, many steps are to use more convenient method, and strive to be simple and clear. In general, there is no special requirements of the software, I have to use the RPM way to install. If you have specific requirements for optimal configuration, security considerations, please refer to the relevant articles for configuration.
In this article, Apache in the DSO mode installation, PHP implementation of the Java component support, so that we are in large-scale project development, you can choose PHP as a front-end scripting language, invoke Java components to implement the low-level and enterprise-class applications.
I. SYSTEM environment
1. Initial installation
Firewall Open Interface: 21,22,80,2401,8009,10000,eth0
Redhat Linux 9.0
Development Tools
PHP 4.3.5
Download Address: http://www.netshine.com.cn/linux/php-4.3.5.tar.gz
JK 2-2.0.4
Download Address: http://www.netshine.com.cn/linux/jakarta-tomcat-connectors-jk2-src-current.tar.gz
5. Client Environment
Windows XP Professional
Absolute Telnet 3.0
Zend Encoder
Macromedia Dreamweaver MX 2004
Borland JBuilder 9 Enterprise
Wincvs 1.3
Download Address: Http://www.netshine.com.cn/linux/WinCvs13b17.zip
Two. System Installation
Start the Linux installation CD and install the basic system: FTP, development tools, and MySQL3.23.54. If you are compiling the installation of MySQL manually, you should remember to compile PHP and other programs to specify the specific path of MySQL, otherwise the path will not find the resulting compilation error.
Three. Install webmin1.110
With Webmin to configure the system, fool, can save a lot of energy, so I usually install it first. The installation process is simple, follow the prompts step by step after executing the setup.sh script.
# CD webmin*
#./setup.sh
Four. Install JDK1.4.2
1. Edit the following three files without specifying the full path in your own home directory.
Helloworld.java
Class HelloWorld
{
public static void Main (string[] args)
{
This file tests whether the Java environment was successfully installed.
System.out.println ("Hello world!");
}
}
2. Execute the following command:
# RPM-IVH j2sdk*.rpm//install JDK package.
# Source/etc/profile//Overload profile environment.
# Ldconfig//Create dynamic link library cache file.
# javac-d. Helloworld.java//Compile test file.
# java HelloWorld//Run program test whether the installation was successful.
Five. Install Apache
# tar Xvzf httpd*//Extract source pack.
# CD httpd*//Enter the installation directory.
#./configure--prefix=/usr/local/apache--enable-so--enable-mods-shared=most--enable-rewrite
# Make;make Install//compile and install.
Description
--ENABLE-SO option: Let Apache support DSO mode, note that we are here to use the Apache2.0 syntax. If your Apache is version 1.3, you should change to--enable-module=so.
--enable-mods-shared=most option: Tells the compiler to compile all standard modules into the DSO module. If you use Apache1.3, change to--enable-shared=max.
--enable-rewrite option: Support address rewrite, use 1.3 version of Friends please change it to--enable-module=rewrite.
Six. Compile and install PHP
1. Executive Order
#tar Xvzf php*/extract Source Pack
#cd php*//Enter PHP installation command
#./configure--prefix=/usr/local/php--with-mysql--with-apxs2=/usr/local
/apache/bin/apxs--with-java=/usr/java/j2sdk1.4.2_04
#make make install//compile and install
#cp php.ini-dist/usr/local/php/lib/php.ini//Copy PHP configuration file
#cd/usr/local/php/lib/php/extensions/no-debug-non-zts-20020429//extensions Directory
#ln-S java.so libphp_java.so//Set up a connection, forget that there will be mistakes OH
#cd zend*//Enter Zendoptimizer directory
#./install//install PHP accelerator
Description
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS is the APACHE2 syntax, the 1.3 version of the user please use--WITH-APXS=/USR/LOCAL/APACHE/BIN/APXS.
/usr/local/apache/htdocs/test.php
<?php
This program tests whether PHP's Java environment is available,
The code is extracted from the http://www.php.net/manual/en/ref.java.php.
Get instance of Java class Java.lang.System in PHP
$system = new Java (' Java.lang.System ');
(1). If you have just switched from a previous version of PHP to a new version, you may find that many of your PHP programs are useless. Take it easy! Turn the register_globals on and everything's fine! This is because the old version of PHP, its register_globals default is open, and the new version, but turned it off.
(2)./home/jim/myclass is the path to my Java component, you can modify it according to the actual situation, but for the sake of security, do not put it under the Web directory OH.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.