The configuration of IIS supporting PHP in Windows Server 2003

Time:2019-12-14

1. Install MySQL (install by default if there is no special instructions)
Select custom custom installation
Click “change” to change MySQL installation directory (customized)
Others can follow the default next step

After installation, it will automatically jump to the setting interface and select detailed configuration for detailed configuration
Select MySQL running mode: server machine
Select the default storage method of MySQL database: non trans only (MyISAM)
Set the maximum number of MySQL connections: generally set to an integer between 128 and 512
Set MySQL network parameters. Note: do not enable strict mode!
Set MySQL default character set: subject to user site language (general GBK)
For Windows environment settings, check all three. Service name is mysql
Next, set the root password. Enable root access from remote is required. If it’s only local access, don’t check it. It’s more secure
Finally, after MySQL installation and configuration, MySQL service will be started automatically.

Test whether MySQL works normally:
Open the CMD command prompt window, and enter the command: MySQL – u root – P after entering the password, if you can enter the MySQL console normally, the MySQL installation is normal. (note that there is no space between – P and password)

2. Install PHP: (I install it under D: \ PHP by default, which can be changed as required)
(1) extract the downloaded php-5.2.4-win32.zip file and copy it to: D: \ PHP;
(2) enter D: \ PHP folder and rename php.ini-dist to php.ini;
(3) open the php.ini file and find: extension  dir = “. /” to change it to;
extension_dir = ” D:\PHP\ext”
(4) find: Windows extensions
In the dynamic module configuration under Windows extensions, you need to open the following module support: (remove the; sign in front of each line of module configuration)
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_MySQL.dll
(5) find:
disable_functions =
Changed to:
disable_functions = phpinfo,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
(6) save php.ini file and copy it to C: \ windows\
According to this installation, PHP can meet the needs of most of the stations. If you have special needs, please refer to the relevant materials of PHP module (extension)

3. Create a new site in IIS (this part is not explained carefully, and there is no point, just pay attention to the need to give the site “read” and “run script” permission)

4. Integrated configuration of IIS and PHP – make the site support PHP (this is the key point)
(1) right click to open the website property just created,
(2) in the site properties window, click the “main directory” tab, click the “configuration” button, and in the new pop-up “application configuration” dialog box, click the “add” button to add the ISAPI support of PHP, and select the executable file: D: \ PHP \ php5isapi.dll, with the extension of. PHP, and the action limit is: get, post. Click OK to add and in the application configuration window to see if the. PHP extension loaded successfully. If successful, click OK to close the configuration window and return to the site properties main window. [this step is more important]
(3) click the “document” tab, add three files index.htm, index.html and index.php to the default content document, and sort all the default documents in the order shown in the following figure. When finished, click OK to close the site property configuration window and return to the IIS manager main interface.
(4) right click “web service extension”, add a new web service extension and PHP extension support.
(5) in the new web service extension dialog box, fill in PHP for the extension, and select d: \ PHP \ php5isapi.dll for the file, and set the PHP extension as allowed by default.
(6) restart IIS service
5. Test whether PHP support is normal
The integration of IIS and PHP has been completed. You need to test whether PHP support is normal.
Create a phpinfo.php file in the root directory of your website, edit it with Notepad, and the content is

Then try to access the page.
If the PHP support information can be displayed normally, the configuration integration is successful.