How to install and configure IIS6/Apache2.2.4 + MySQL5.2 + PHP5.2.1 in Windows _ PHP Tutorial

Source: Internet
Author: User
Tags php book
Install and configure IIS6Apache2.2.4 + MySQL5.2 + PHP5.2.1 in Windows. I saw a book on php in, and it was still php3. looking back on the prospect of php on the web in four years, it was still bright! Php, which has not been seen for three years, has already reached php5. now I have read a php book in 03 years. at that time, it was still php3, looking back at the prospect of php's web development over the past four years, it is still bright! Php, which has not been seen for three years, has reached php5. now I have been writing the first php WEB for three or four months, I am writing www.kuomart.com in my spare time. I think I have been using Windows2003 + IIS6 + PHP5.0.7 + MYSQL4.1 for development, until yesterday when my host re-installed the Trojan, kav did not find any reason, and I did not find any suspicious exposure. so I simply re-installed xp, because the TV1000 TV card can only run normally in xp, the configuration was successful once in the 2003 system, but a hardware error occurs on the blue screen! Therefore, simply install the web development part of my development environment under 2003 in xp. I really want to install the lamp environment, but considering that there is too much data on the machine and it is difficult to operate, let's talk about it when I have the money to buy a hard disk or it's just that day. So we started to configure the environment at noon today!

To the http://www.apache.org to download the latest version of apache apache.2.24, after installation how did not find the service, the original I chose only the second item, select this need to manually add windows service! Baidu understands it after a while, so if you are installing it for the first time, you will continue to do the next step and do not set any unnecessary settings, the operation will certainly be OK!
The next step is to install php. I started to install php5.0.4 and 4. I won't talk much about installing php. I will post the information I found below. Then, the configuration for apache to support php is modified, of course, httpd. conf, but I

Open the C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ conf \ httpd. conf file in Notepad and modify it:
① Found:
AddType application/x-gzip. gz. tgz
Add the following lines below:
AddType application/x-httpd-php. php
AddType application/x-httpd-php. php4
AddType application/x-httpd-php. php3
AddType application/x-httpd-php. phtml
AddType application/x-httpd-php-source. phps
AddType image/x-icon. ico
② Find:
# LoadModule ssl_module modules/mod_ssl.so
Add a row below:
LoadModule php5_module C: \ php5 \ php5apache2_2.dll
(Note: If your Apache version is 1. for example, LoadModule php5_module C: \ php5 \ php5apache. dll; if your Apache version is 2.0.x-2.2.x, it should be LoadModule php5_module C: \ php5 \ php5apache2. dll, I have paid a great deal to find this point !)
③ Find:
DirectoryIndex index. php...
In this line, you can add the default file name as follows:
DirectoryIndex index. php default. php index.htm index.html default.htm default.html

How can I add the LoadModule php5_module C: \ php5 \ php5apache2_2.dll statement incorrectly?
Requested error

Of course, this is usually a problem between baidu or google. it turns out to be a problem between different versions. I think yes. find the corresponding configuration information as follows:

I. download the latest Apache2.24, MySQL5.2, PHP5.2.1 [: http://cn.php.net/downloads.php note: At the same time download php-5.2.1-Win32 and pecl-5.2.1-Win32 (extension package), the format is the decompressed that, rather than exe or msi directly installed that.] (Use baidu to search for the specific address ).

II. install and configure PHP5.2.1
1. decompress the PHP5.2.1 compressed package to C: \ PHP5 (this path and file name can be arbitrary, but if you use this path and file name below, if you are not using this path and file name, please make changes accordingly ).
2. copy the following files under the C: \ PHP5 directory to the windows system folder, which varies depending on the Windows version (if it is Windows9x/ME, it is c: \ windows \ E; for Windows NT/2000, it is c: \ winnt \ system32; for Windows XP/server2003, it is c: \ windows \ system32. C: \ is the system disk of your current operating system. if your current operating system is not installed in C: \ windows, modify it accordingly)
Php5ts. dll
Fdftk. dll
Fribidi. dll
Gds32.dll
Libeay32.dll
Libmcrypt. dll
Libmhash. dll
Libmysql. dll
Libswish-e.dll
Msql. dll
Ntwdblib. dll
Ssleay32.dll
Yaz. dll
3. php. ini-dist is renamed as php. ini. ini-recommended is renamed to php. ini, this configuration file does not add "//" to the added content, which reduces security, but is more convenient. Decide which one to choose.) copy php. ini to C: \ windows \ (XP/2003/9 x/Me) or C: \ Winnt \ (2000/nt), open it in Notepad and make the following changes:
① Search for this line of extension_dir =./and point its path to the extensions directory under your PHP Directory. modify it to: extension_dir = C: \ PHP5 \ ext
② If you want to support more modules, follow these steps. if you don't want to, simply save the php. ini file.
PHP supports many modules, but some dll files are not free of charge, so they are not released along with the PHP compressed package. However, there are many modules in the dlls folder, we copied them to the system32 folder just now. now we can test how many modules it supports. The following are my test results for your reference only. if The xxx. dll module is not supported after installation, simply add the semicolon. Search:
Windows Extensions
; Note that MySQL and ODBC support is now built in, so no dll is needed for it.

The following sections describe the supported extension modules with semicolons. if you want PHP to support a certain module, remove the previous ";". The following is the result of my test, it is normal to remove the comment as follows:
Extension = php_bz2.dll
Extension = php_c2.16.dll
Extension = php_crack.dll
Extension = php_curl.dll
Extension = php_db.dll
Extension = php_dba.dll
Extension = php_dbase.dll
Extension = php_dbx.dll
Extension = php_domxml.dll
Extension = php_exif.dll
Extension = php_fdf.dll
Extension = php_filepro.dll
Extension = php_gd2.dll
Extension = php_gettext.dll
Extension = php_hyperwave.dll
Extension = php_iconv.dll
; Extension = php_ifx.dll
; Extension = php_iisfunc.dll
Extension = php_imap.dll
Extension = php_interbase.dll
Extension = php_java.dll
Extension = php_ldap.dll
Extension = php_mbstring.dll
; Extension = php_mcrypt.dll
Extension = php_mhash.dll
Extension = php_mime_magic.dll
Extension = php_ming.dll
Extension = php_mssql.dll
Extension = php_msql.dll
; Extension = php_oci8.dll
Extension = php_openssl.dll
; Extension = php_oracle.dll
Extension = php_cmd.dll
Extension = php_pgsql.dll
; Extension = php_printer.dll
Extension = php_shmop.dll
Extension = php_snmp.dll
Extension = php_sockets.dll
; Extension = php_sybase_ct.dll
Extension = php_w32api.dll
Extension = php_xmlrpc.dll
Extension = php_cmdt.dll
Extension = php_yaz.dll
Extension = php_zip.dll
After the modification is complete, save php. ini.
Decompress the pecl-5.2.1-win32.rar package and copy all the files to the C: \ PHP5 \ ext folder. (This folder stores the extension files of PHP5.2.1. if you have compiled PHP extensions in C, you can also put them in this folder)
④ Create a folder named session in the C: \ PHP5 directory. (This folder is used to save sessions, because PHP does not have long-standing memory variables like the application in ASP, so for storing the initial query conditions for paging or shopping cart, session is almost the only option. But this folder needs to be cleaned regularly later)

This completes the installation and configuration of PHP.

III. Mysql installation
Mysql is relatively independent. This database is very small and cannot be operated directly. Unlike access or SQL2000, it does not have graphical management tools, however, there are already many graphical management software that can be used well, such as EMS SQL Manager 2005 for MySQL (the best MySQL management software is strongly recommended), Navicat, phpMyAdmin, and mysqlcc. These software can be downloaded from the Internet, which is not described in detail here.
1. after downloading and obtaining the Mysql for win32installation package, open it with winzipand run setup.exe directly. Note that you should select an installation path. of course, the installation path can be any, but we recommend that you install it with PHP and select the C: \ MySQL directory.
2. after the installation is complete, MySQL automatically enters the setup stage. Configure according to the default mode, and enter the password to complete the settings. (The default username is root, and the password is blank)
3. Generally, the service will be automatically started after installing MySQL. if it is not started, double-click C: \ MySQL \ bin \ mysqld-nt.exe to run.
4. if you have downloaded several management software mentioned above, you can use them for MySQL management.

4. IIS configuration (either of them or the fifth option)
Open IIS, right-click on "default Web site" to open properties, and perform the settings shown in the following figure in the main directory. Note the steps:


After that, the IIS + PHP + MySQL environment is set up.

5. installation and configuration of Apache (and the fourth option)
If you have not installed IIS, install Apache, a small and powerful Web server. the installation directory is recommended to be the same as that of PHP. select C :\. The default installation directory is C: \ Program Files:
1. download the installation file Apache2.2.4 for win32.Msi and double-click it to automatically install Apache.
2. during the installation process, follow the prompts to enter localhost in the first blank line from top to bottom, and enter your name and email address in the remaining two blank lines (whatever you enter) to complete the installation configuration.
After installation, the apache icon is displayed in the system tray in the lower right corner of the desktop. you can double-click the Apache control panel to stop or restart the server.
3. configuration of Apache2.2.4
Open the C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ conf \ httpd. conf file in Notepad and modify it:
① Found:
AddType application/x-gzip. gz. tgz
Add the following lines below:
AddType application/x-httpd-php. php
AddType application/x-httpd-php. php4
AddType application/x-httpd-php. php3
AddType application/x-httpd-php. phtml
AddType application/x-httpd-php-source. phps
AddType image/x-icon. ico
② Find:
# LoadModule ssl_module modules/mod_ssl.so
Add a row below:
LoadModule php5_module C: \ php5 \ php5apache2_2.dll
(Note: If your Apache version is 1. for example, LoadModule php5_module C: \ php5 \ php5apache. dll; if your Apache version is 2.0.x-2.2.x, it should be LoadModule php5_module C: \ php5 \ php5apache2. dll, I have paid a great deal to find this point !)
③ Find:
DirectoryIndex index. php...
In this line, you can add the default file name as follows:
DirectoryIndex index. php default. php index.htm index.html default.htm default.html

Save the file and restart the apache server. The PHP environment has been fully established.

VI. Zend Optimizer installation configuration (optional)
After the download is a. exe file, you can directly install it. during the installation process, you must select the PHP version. here I select php5.2.1 to check whether to back up php. ini. Click OK and the installation will end.
Open php. ini and modify the following content:
Find:
[Zend]
You can see below:
Zend_optimizer.optimization_level = *
In this line, change the value after "=" to 1023, that is, change this line:
Zend_optimizer.optimization_level = 1023
Save and restart Apache/IIS. the installation is complete.

7. test
Create a file in Notepad and write the following lines:
Phpinfo ();
?>
Rename the file phpinfo. php, save it to the C: \ Apache Software Foundation \ Apache2.2 \ htdocs Directory (which is the root directory of your site), and enter http: // localhost/phpinfo in the browser. php.
If you can see the relevant PHP information, it proves that the installation and configuration of the IIS6/Apache2.2.4 + MySQL5.2 + PHP5.2.1 environment in Windows are successfully completed!

Success! Php, which has not been seen for three years, is now in php5...

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.