Configure apache2.0.52 + php5.0.2 + mysql4.0 _ MySQL in WIN2000/XP

Source: Internet
Author: User
Configure apache2.0.52 + php5.0.2 + mysql4.0 Apache in WIN2000XP

◆ 1. use software:

Apache_2.0.52-win32-x86-no_ssl
Php-5.0.2-Win32
Mysql-4.0.21-win
PhpMyAdmin-2.6.0

Configuration environment: Windows Xp sp2

◆ II. basic installation steps

Note: Do not use spaces in any directory or file name during the installation process,

Instead of using D:/Program Files, use D:/ProgramFiles.

1. apache_2.0.52-win32-x86-no_ssl

For apache server software, I downloaded the Windows version, and the configuration of the 2.0 series is similar.

Double-click to install apache2.0.52. I will install it on D:/apacheGroup. Note that the directory name should not contain spaces. Otherwise, the following php settings will cause an error. After the installation is complete, apache runs automatically. enter http: // 127.0.0.1 in the browser to check whether the default webpage is displayed. if you do not want to see this page, go to D: find httpd in the/apacheGroup/apache2/conf directory. conf open edit and find DocumentRoot. "in the 2.0 series, only one DocumentRoot is found. change the path in the quotation marks to your own path, for example, the default root directory of DocumentRoot "D:/php" is D:/php. Note that "/" is used here.

2. install php5.0.2

The downloaded php-5.0.2-Win32 is generally a zip compressed package, decompress to D:/apacheGroup directory, and make the files in a folder, change the folder name php5, this facilitates the subsequent work. Now we can see that there are already two folders under D:/apacheGroup. one is apache2 (a folder automatically generated by installing apache2.0.52) and the other is php5. my approach is to use one folder for each software, and these folders are in the same directory for easy searching. Now we can configure apache to support php5.

First, rename php. ini-dist in the directory D:/apacheGroup/php5 to php. ini and copy it to the directory C:/WINDOWS,

Then, copy php5ts. dll under the D:/apacheGroup/php5 directory and libmysql. dll to C:/windows/system

Next, we will start to configure the httpd. conf file under D:/apacheGroup/apache2/conf and open httpd. conf (available in Notepad)

(1) find the adddefacharcharset ISO-8859-1 and change it to adddefacharcharset GB2312 (let the default language encoding to simplified Chinese)

② Locate DirectoryIndex index.html. var and add index.htm index. php index. php3

------------------- Modular installation configuration ------------------------

Find the # LoadModule ssl_module modules/mod_ssl.so line, and add a line after this line

LoadModule php5_module D:/apacheGroup/apache2/php5/php5apache2. dll

D:/apacheGroup/apache2/php5/For Your php Directory, find the AddType application/x-gzip. gz. tgz line, and add a line after this line

AddType application/x-httpd-php. php

------------------- CGI installation configuration -----------------------------

Find AddType application/x-gzip. gz. tgz and add the following line:

ScriptAlias/php/"D:/apacheGroup/apache2/php5 /"

AddType application/x-httpd-php. php

Action application/x-httpd-php "/php/php-cgi.exe" here there are two main tasks to do, one is to copy php. ini to the system disk, the other is to configure httpd. conf to make it support php5, which must be in the absolute path, for example, D:/apacheGroup/apache2/php5/cannot contain spaces in the middle; otherwise, apache2.0.45 will fail!

Now, let's see if your apache already supports php!

3. install mysql-4.0.21-win

Because apache is configured in windows, mysql is also used in windows. After decompression, install mysql4.0.21 to the D:/apacheGroup/directory and install mysql in the mysql Directory (you can change the folder name in the selected installation path, there are no specific requirements for installing mysql, mainly the configuration of the next step.

Start mysql first (if it has already been started, you don't need to start it again. check whether there is a green light in the taskbar). now, my mysql has been installed to D: if the/apacheGroup/mysql directory is located, go to D:/apacheGroup/mysql/bin to find winmysqladmin.exe and double-click. mysql runs automatically.

Now, you have started configuring php. ini. Go to C:/WINDOWS, open php. ini, and find

Extension_dir = "./"

Change

Extension_dir = "D:/apacheGroup/php5/ext"

Find
; Extension = php_mysql.dll
Replace ';'
Extension = php_mysql.dll

Find
; Session. save_path = "/tmp"
Remove ';' from the directory where you saved the session, as shown in figure
Session. save_path = "D:/apacheGroup/php5/session_temp ";

Now, we have succeeded!

4. phpMyAdmin-2.6.0 configuration

Decompress phpmyadmin-2.6.0.zip to the custom WEB root directory, and rename the folder phpmyadmin or other

Open config. inc. php in The phpmyadmin Directory

Find

$ Cfg ['servers'] [$ I] ['user'] = 'root ';
$ Cfg ['servers'] [$ I] ['password'] = '000000 ';

Enter your mysql User and password respectively.

Super practical supplement:

1. php. ini configuration

Register_globals = On

Some programs require this support; otherwise, files cannot be uploaded.

2. prohibit browsing directories

Remove all indexes from httpd. conf.

The user will not be able to see the directory list

3. edit the httpd. conf file and add a line to the file.

Alias/test/"c:/php/test /"

4. Allows browsing specific virtual directories

Alias/test/"D:/php/test /"

Options Indexes FollowSymLinks

Write the above code to the end of httpd. conf

Note:

Row 1: map the virtual directory test to the real physical path D:/php/test

Row 3: Options Indexes FollowSymLinks allows you to browse files under the virtual directory test.

5. global configuration of apache2.0.52

ServerAdmin webmaster @ ****. net is set as the administrator's email address.
ServerName www. ****. net: 80 host name (either domain name or IP address) and Port Address
DocumentRoot "D:/php" website root directory

DirectoryIndex index. php index.html index.htm index. php3 index.html. var add the default document

ServerTokens Full: displays server information, Full: all, and Prod: Minimum. it is recommended to set it to Prod, which is not easy to expose server information.

AddType application/x-httpd-php. php. phtml. php3. php4 added support for php, phtml, php3, and php4 files

◆ 3. advanced settings:

Now, even if the entire system is basically complete, the rest are some advanced settings:

Advanced features of apache:

1. configure the ActivePerl-5.8.4.810-MSWin32-x86 (to support cgi/pl)

Install the plugin in the directory D:/apacheGroup/Perl (preferably c:/usr). to facilitate file management, install perl in the directory D:/apacheGroup/Perl.

Start setting httpd. conf automatically converts the D:/apacheGroup/apache2/cgi-bin directory to a virtual directory (it is best to put all cgi programs under this directory. If the image cannot be displayed normally, restart the computer, after restart, the cgi program can be stored in the root directory. after testing, the cgi program runs normally in the root directory and the images are displayed normally .)

(1) search for the following Options statement. remove All the following parameters and add an All parameter. pay attention to case sensitivity. Let's look at AllowOverride, remove None, and add an All

(2) search. there is an option in the eighth row below. remove All the following parameters and add an All parameter. note the case sensitivity. Then there is a AllowOverride in the number of rows, and the following None is also removed, and an All

(3) search for # ScriptAlias/cgi-bin/"D:/apacheGroup/apache2/cgi-bin/" and remove #

(4) look for it. in the following example, AllowOverride removes the following parameter and adds an All parameter. note the case sensitivity. Next, an option will remove None and add an All

(5) search for AddHandler cgi-script. cgi followed by. pl, that is, AddHandler cgi-script. cgi. pl.

(6) If you want to add SSI, remove the # before the following two rows.

AddType text/html. shtml
AddOutputFilter between Des. shtml
AddHandler server-parsed. shtml

Pay attention to the perl interpretation path in the perl script. the default # of all cgi or pl file headers must be added #! Change/usr/Perl/bin/perl.exe #! D:/apacheGroup/Perl/bin/perl.exe is the absolute path of your perl.exe! (If you use the c:/usr directory for installation, you do not need to change it. we strongly recommend that you install perl in the c:/usr directory.) now, cgi and pl can be successfully parsed!

Summary: there is a directory where perl.exe is located, installed in the c:/usr directory, which can reduce unnecessary settings (for example, set each cgi/pl file header #! /Usr/Perl/bin can also be modified in batches using ultraedit32. that's what I do !)

2. installation of zendOptimizer255Windows-i386 (optimizing php performance)

Double-click the zendoptimizer255windows-i386.exe file to install it. during the installation process, the installation directory of apache and php are selected. the directory where ini is located. it can be automatically identified. if it cannot be found manually, it will be automatically started after installation, and no settings are required! This software can automatically set php. ini for php execution program optimization!

Test: compile the php page: the code is as follows:

Phpinfo ();
?>

Save as info. php

Run info. php to check whether the zend Engine is used!

Now, all the components are installed! Put it into use!

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.