First, PHP
Current version 4.3 1. PHP.INI-DIST REM is php.ini, copy to winnt, copy php4tsts.dll to winnt / system32, no need to copy or change other settings.
2. PHP.INI:
Register_globals = Off -> on extension = php_gd.dll Removes the comment, start the GD library extension_dir = ./ -> C: / PHP / EXTENSInsions
---------------------------------
Second, install Apache
Currently installed version 2.0.43 Configuring the httpd.conf file under the conf directory
# Install Apache Module How to add: loadModule PHP4_Module C: /PHP/SAPI/php4apache2.dll addtype application / x-httpd-php .php addtype application / x-httpd-php .php3 #alias / www / "c: / documents and Settings / Administrator / WWW / "(Virtual Directory, Custom)
# Install CGI mode Add: Scriptalias / PHP / "C: / PHP /" AddType Application / X-httpd-php4 .php Addtype Application / X-httpd-php4 .php3 action application / x-httpd-php4 "/ PHP / PHP "
# Add default startup document: DirectoryIndex index.html Add to: DirectoryIndex Index.html Index.htm Index.php Index.php3
# Let Apache2 default Chinese display # Add: addlanguage zh-cn .cn defaultlanguage en-cn # modified: adddefaultcharset ISO-8859-1 ---> AddDefaultcharset GB2312 ############## ##########################################
Test file info.php:
phpinfo ()?>
Enter http://localhost/info.php in the browser
---------------------------------------------
Third, MySQL installation
1. The default installation path is: c: / mysql
2. Run C: / MySQL / BIN / WINMYSQLADMIN, enter your username, password
// If you don't have this service: Open "Run" input c: / mysql/bin/mysqld-nt.exe -install. Then open the Administrative Tools -> Services to find the "MySQL" service and start it. Restart Windows2000.
============================================================================================================================================================================================================= ================== If JSP does not require JSP, install it to this. Let's start installing JSP ================================================= =======================4, install related software
1, download a JDK (J2SDK-1_4_0-win.exe), assume that it is installed as C: / J2SDK.
2, download the Resin for Windows version (2.1.6), address: http://www.caucho.com/download/, solution ... resin / bin / httpd -install, if you want to serve from the system service Delete, execute "C: / Resin / Bin / httpd - remove" on the command line.
3. Download the JDBC for MySQL file named mm.mysql-2.0.14-bin.jar Copy to c: / resin / lib directory (for JSP support MySQL). ----------------------------
V. Configure environment variables
Right-click on my computer -> Property -> Advanced -> Environment Variables -> System Variable Bar
1. Java_home Click "New ...", the variable name column fills in "java_home", the variable value column fills in "C: / J2SDK" and click "OK".
2, resin_home New a variable "resin_home", the value is "c: / resin".
3, ClassPath found ClassPath in the system variable bar, click "Edit ...", if there is no change, click "New ...", add C: /j2sdk/lib/tools.jar after the variable value; c : /j2sdk/lib/dt.jar; ", click" OK ".
Test Service: Execute: http: // localhost: 8080 You can see some environment variables of the current RESIN server. ---------------------------
Six, configure Apache bundle RESIN,
Perform a C: /RESIN/bin/setup.exe Select the Apache2 service, which will automatically add the C: /Apache/conf/httpd.conf file.
Or open C: /Apache/conf/httpd.conf, add loadModule caucho_module "c: /resin/libexec/apache-2.0/mod/caucho.dll"
----------------------------
Under the C: / Apache / HTDOCS / directory, new file Test.jsp, the content is as follows:
2 2 = <= 2 2>
Run http: //localhost/test.jsp: 2 2 = 4 Description Apache Resin Configuration is completed.
-------------------------
Test mysql connection:
Suppose a database mysql is created in the MySQL database species, named User in the C: / Apache / HTDOCS / directory newly built a file Test-mysql.jsp, the content is as follows:
<% @ page language = "java" import = "java.sql. *" ContentType = "text / html; charSet = GB2312"%> <% string ls_username = "root"; // database username String Ls_password = "xxxxxx "; // password string ls_server =" localhost "; string ls_dbname =" mysql "; // database name connection connAn null; try {// registration JDBC connection drive class.forname (" org.gjt.mm.mysql.driver "); // Establish connection with the database Con = DriverManager.getConnection (" JDBC: MySQL: // " LS_SERVER " / " LS_DBNAME, LS_USERNAME, LS_PASSWORD);} catch (Exception E) {system.out.println (e) .tostring ());}%>
} Catch (Exception E) {Out.println ("
2" E.TOString () "
");} Out.println ("A total of" li_count "record
test success ! ");%> Body> html> <% try {if (inc! = Null) Con. close ();} catch (sqlexception sqle) {system.out.println (sqle.toString ()) }%> If you access Test.jsp to access the database, you can.