Installation configuration of Iis/apache+php+mysql under Winodws

Source: Internet
Author: User
Tags configuration php iis ini phpinfo small web server win32 zip zend


The efficiency of PHP is obvious, this is one of the reasons I like it, and it is called a wonderful partner MySQL and Apache want to merge, cannot but marvel at its efficiency. PHP updates are also very quick, here is the latest version of PHP4.3.2RC4 (almost no bugs, it is estimated that after the end of the formal version of the post), and the latest version of the Mysql4.0.13 installation process.

PHP installation files can be downloaded directly to the Win32. Zip package (5.8M)
MySQL installation files can be downloaded directly to the for Win32. zip package
In addition, if you want to experience the effects of Apache and PHP to give up IIS, please go to to download the latest for win31. MSI installation package, currently the latest version is 2.0.45.
In addition, you can download the Zend Optimizer to speed up PHP. Specific access to

<1> Installation configuration PHP

1. Unzip the PHP compression package to the c:php (this path can be arbitrary, but the following if you use this path, please modify accordingly).

2. Copy all files in the Php4ts.dll and C:phpdlls directories under the c:php directory into Windows system folders, depending on the version of Windows

If it is a Windows 9x/me c:windowssystem

If it is a Windows nt/2000 c:winntsystem32

If it is a Windows xp/server2003 c:windowssystem32

where C: for the system disk you are using now, if your current operating system is not installed under C:windows, please make changes accordingly.

Copy Php.ini-dist to C:windows (xp/2003/9x/me) or c:winnt (2000/nt) and rename it to PHP.ini. Open with Notepad, modify the information:

Search Extension_dir =./This line and refer its path to the extensions directory in your PHP directory, such as:

Extension_dir = c:phpextensions

If you want to support more modules, please take the following to do, if not, save the php.ini file directly.

PHP supports a lot of modules, but some DLLs are not free, so there is no compression package with PHP release, but the DLLs folder is very much, we have copied them to the System32 folder, and now we test to see how many modules it supports. The following is my test results, for reference only, if the installation is completed, pop-up does not support the Xxx.dll module, the front semicolon plus go on it, search:

; Windows Extensions

; Note that MySQL and ODBC support are now built in, so no DLL are needed for it.


below are separated by semicolons in front of the supported extension module, if you want PHP to support a module, please forward the ";" Remove can, the following is my test results, generally follow the following way to remove comments after no problem:

















; Extension=php_ifx.dll

; Extension=php_iisfunc.dll






; Extension=php_mcrypt.dll






; Extension=php_oci8.dll


; Extension=php_oracle.dll



; Extension=php_printer.dll




; Extension=php_sybase_ct.dll






After the
modification is complete, save the php.ini to complete the installation and configuration of PHP.

Installation of <2>mysql
MySQL is relatively independent, the database is very small, can not directly operate it, unlike access or SQL2000 so intuitive, but there are already a lot of software can be very good operation of it, such as PHPMYADMIN,MYSQLCC. These software can be downloaded to the, which is not described in detail here.
Get MySQL for Win32 install package, open with WinZip, run directly Setup.exe, need to pay attention to select an installation path, of course, the installation path can be arbitrary, but I recommend it and PHP installed together, select the C:mysql directory. MySQL is complete after the installation is complete. As for setting up users and passwords, you can manage them using the two software mentioned above. This does not continue to describe, the default username is root and the password is blank.
After the general installation of MySQL will automatically start the service, if not started, please run C:mysqlbinmysqld-nt.exe

The next installation depends on what you choose to use as your Web server, I suggest using Apache, and if you feel you are in conflict with IIS, use IIS directly.

<3>iis configuration:
Open IIS, right-click on the default Web site, and make the settings in the home directory as shown in the following illustration, and note the steps:

After the completion of the IIS+PHP+MYSQL environment is established.

<4> If you do not have IIS, then we install Apache this small Web server:
We downloaded to the for Win32 is an MSI installation file, directly double-click it will automatically perform Apache installation, follow the prompts to install, The things you want to write in accordance with your preferences, no effect, of course, the directory I still suggest you and PHP directory so, choose c: Directory, so that after installation can see c:apache2. After loading will be in the desktop right corner of the system tray display Apache icon, double-click can open the Apache Control Panel, you can stop or reboot the server.
here to do is to modify the c:apache2confhttpd.conf file, open in Notepad:
#NameVirtualHost *
modified to:
Modify the following lines:
ServerAdmin (Administrator's mailbox you entered when you just installed)
DocumentRoot C: Apache2htdocs
ServerName Apache2
ErrorLog c:apache2logserror_log
Customlog c:apache2logsaccess_log Common
AddType application/x-tar. tgz
Add the following two lines below:
AddType application/ x-httpd-php. PHP
AddType image/x-icon. ico
#LoadModule ssl_module modules/
Add a row below:
LoadModule php4_module c:phpsapiphp4apache2.dll
Add default file:
Find DirectoryIndex * This line, you can modify this, add the default file name:
DirectoryIndex index.php default.php index.htm index.html default.htm> Save the file and restart the Apache server.

The environment for this PHP has been completely established.

Installation of <5>zend Optimizer (can not be installed)
After the download is an. exe file, directly installed on it, the installation process to choose your PHP version, you must choose accurate, here I choose PHP 4.3.x before the installation prompts whether to backup php.ini, the point is determined after the installation is finished.
Open PHP.ini, modify a place:
Found it:
You can see the following:
This line,
Change the value of = to 1023, which means to change the line to
After the save on the OK Oh, restart Apache/iis, to this installation is all over. I am also very tired AH:)

<6> Test:
Use Notepad to create a new file, write down the following lines, save to the C:apache2htdocs directory, this directory is your site and directory, named phpinfo.php. then enter http://localhost/in the browser Phpinfo.php will be able to see all the information about PHP.

Phpinfo ();


You need to be aware that when you save a file, the file's suffix name should be. php. (Notepad automatically adds a. txt suffix to the file name unless you take one of the following measures to avoid this.) When you save the file, the system will let you specify the file name, and then enclose your file name. (For example, "hello.php".) Alternatively, you can click the Save as Type Drop-down menu in the Save dialog box and change the setting to "All files." This allows you to enter a filename without quoting.
The above paragraph excerpt from "PHP Chinese Manual", more detailed installation material, please download this Chinese manual to the, inside has each kind of different system's detailed installment, but is not very intuitive, some optimizations also did not write out:)

Below I give a few software to use the download address:
PHP4.3.1 Stable version:

Mysql4.0.13 Stable version:

Apache2.0.45 Stable version:

Zend Optimizer:

In addition, the PHP4.3.2RC4 contains the pear package, PHP4.3.1 is not, if you download a compressed package, set the include path in PHP.ini, find the following two lines:
; Windows: "Path1;path2"
; include_path = ".:/ Php/includes "
Modified to:
; Windows: "Path1;path2"
include_path = "C:phppear"
Save, this is the PHP include file path, you can set multiple, with ";" Lattice open.

Related Article

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: 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.