IIS 6's best configuration method for

  
Although the LAMP combination is very good, if you want to set up a Web virtual host server that supports PHP, ASP, ASP.NET, JSP, Perl, it is best to use IIS 6 for Windows 2003. . There are a lot of articles on the web that explain configuring PHP on IIS 6, but those methods are not bad performance or upgrades. The following method will allow you to upgrade very easily after the first configuration.

The upgrade mentioned here refers to upgrading from a php4 version to another php4 version, or upgrading from one php5 version to another php5 version, rather than upgrading from php4 to php5.

Prepare:

1. A Windows 2003 server is installed and IIS 6 is installed.

2, download the PHP version of the PHP binary package

Installation:

Unzip the PHP binary package to the C:\\php directory (here assuming C: disk is The system disk, that is, the disk on which the Windows system is installed. If the system disk is the D: disk, it is extracted to the D:\\php directory, and so on, the same below).

Then open "My Computer" -> "Properties" -> "Advanced" -> "Environment Variables" -> "System Variables" -> "path", edit its value, Add the following path address in front:


C:\\php;C:\\php\\dlls;C:\\php\\extensions;C:\\php\\sapi;

Copy php.ini-dist or php.ini-recommended to the C:\\Windows directory and rename it to php.ini. The server that officially publishes the website uses php.ini-dist, and is used as a server for debugging. Php.ini-recommended is better. Of course, in general, this php.ini still needs to be modified according to the actual situation.

Let's introduce a few of the necessary modification options:


extension_dir = "C:\\php\\extensions"

This is the PHP extension. Place the directory, make sure it is the same as the directory you actually installed.

extension=php_mbstring.dll
;extension=php_big_int.dll
extension=php_bz2.dll
extension=php_cpdf.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_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_pdf.dll
extension=php_pgsql.dll
;extension=php_printer .dll
exten Sion=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_xslt.dll
extension=php_yaz.dll
extension=php_zip.dll
Above, the opening without the semicolon is the open extension, and the semicolon is an extension that is not open. The above settings include all extensions that can be opened with the default installation on Windows 2003 (here listed for php 4).

session.save_path = c:\\sessions
This is the directory where the session file is saved by default. This directory must be an existing directory, otherwise the default session function will be invalid. I am setting up a directory on a ramdisk. Setting session.save_path on the ramdisk speeds up session processing. If you don't have a ramdisk installed, you can assign it to any directory on another disk, such as the C:\\sessions directory, the C:\\Windows\\Temp directory, and so on.

OK, the basic work is done, now it is time to configure IIS.

Open "Internet Information Services (IIS) Manager", in "Web Service Extension", select "Add a new Web Service Extension", the extension can be filled in "PHP ISAPI Extension", the required file Select: C:\\php\\sapi\\php4isapi.dll (if PHP5 is installed, this is C:\\php\\sapi\\php5isapi.dll, the same below), and set the extension status to Allow.

Open "Website" -> "Properties" -> "ISAPI Filter" -> "Add", the filter name can be filled in "PHP", the executable still selects C:\\php\\ Sapi\\php4isapi.dll.

Open "Website" -> "Properties" -> "Home Directory" -> "Application Settings" -> "Configuration" -> "Application Extensions" -> Add ", the executable file still chooses C:\\php\\sapi\\php4isapi.dll. Fill in the extension ".php" and the action is limited to "HEAD, GET, POST".

Open "Website" -> "Properties" -> "Documents" -> "Enable Default Content Document" -> "Add" to add index.php as the default content document.

Then select "Server Machine Name" -> "All Tasks" -> "Restart IIS" to restart IIS.

Test

In the default website publishing directory, create a test page:

Download: phptest.php

<?php
phpinfo ();
?>
If you open this page to see the php installation configuration information, even the installation is successful.

If you want to optimize the execution of the php program, you can install ZendOptimizer-2.6.0-Windows-i386.exe. This installation is very simple and will not be introduced here.

Upgrade

Now upgrading is very simple. Just download the new version of the PHP binary tarball, remove the original C:\\php directory, extract the new version to the C:\\php directory, and restart IIS. There is no need to modify any configuration or copy any files into the System32 directory. Is it very convenient?

Copyright © Windows knowledge All Rights Reserved