How to configure IIS6 PHP

Source: Internet
Author: User
Tags sapi website server

Although the lamp combination is good, if you want to set up a web virtual host server that supports both PHP, ASP, ASP. NET, JSP, and Perl, Windows 2003 IIS 6 is the best. There are many introductions on how to configure PHP on IIS 6. Article But those methods are either poor performance or difficult to upgrade. The following method allows you to easily upgrade after the first configuration.

The upgrade mentioned here refers to upgrading from a PhP4 version to another PhP4 version, or from a PhP5 version to another PhP5 version, rather than from PhP4 to PhP5.

Preparation:

1. An installed Windows 2003 Server with IIS 6 installed.

2. Download the PHP Binary Package for Windows

Installation:

Decompress the PHP binary package to the C: \ PHP Directory (assume that the C: disk is a system disk, that is, the Windows system disk is installed. If the system disk is a D: disk, decompress it to D: \ PHP Directory, and so on ).

Choose "my computer"> "properties"> "advanced"> "environment variables"> "system variables"> "path" to edit the value, add the following path address:

C: \ PHP; C: \ PHP \ DLLs; C: \ PHP \ extensions; C: \ PHP \ SAPI;

Set PHP. ini-Dist or PHP. copy ini-recommended to the C: \ Windows directory and change it to PhP. INI. Generally, PHP is used to officially launch the website server. ini-Dist, and PHP. ini-recommended is better. Of course, in general, this PHP. ini still needs to be modified according to the actual situation.

The following describes several necessary modification options:

Extension_dir = "C: \ PHP \ extensions"

This is the directory where PHP extensions are placed. Make sure that the directory is the same as the one you actually installed.

Extension = php_mbstring.dll

; Extension = php_big_int.dll

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_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

In the above cases, the open extension is not given a plus sign at the beginning, and the extension that is not opened is added with a semicolon. The above settings contain all extensions that can be enabled by default during Windows 2003 installation (PHP 4 is listed here ).

Session. save_path = c: \ sessions

This is the default session file directory, which must be an existing Directory. Otherwise, the default session function will be invalid. Here I set a directory on a ramdisk. Setting session. save_path on ramdisk can speed up session processing. If ramdisk is not installed, you can specify it to any directory of other disks, such as the C: \ sessions directory and C: \ WINDOWS \ temp directory.

OK. The basic work is finished. Now it is time to configure IIS.

Open "Internet Information Service (IIS) manager", select "Add a new Web Service extension" in "Web Service extension", and enter "php ISAPI extension" for the extension ", select the required file: C: \ PHP \ SAPI \ php4isapi. DLL (if PhP5 is installed, c: \ PHP \ SAPI \ php5isapi is used here. DLL, the same below), and set the extension status to allow.

Open "website"-> "properties"-> "ISAPI filter"-> "add", enter "php" as the filter name, and select "C" as the executable file: \ PHP \ SAPI \ php4isapi. DLL.

Open "website"-> "properties"-> "main directory"-> "ApplicationProgramSet "->" configuration "->" application extension "->" add ". For the executable file, select c: \ PHP \ SAPI \ php4isapi. dll. Enter ". php" for the extension, and set the action to "head, get, post ".

Choose "website"> "properties"> "document"> "enable default content document"> "add" to add index. php as the default content document.

Select "server machine name"> "all tasks"> "restart IIS" to restart IIS.

Test

Create a test page under the default website release directory:

Download: phptest. php

Phpinfo ();

?>

If the PHP installation configuration information is displayed on this page, the installation is successful.

If you want to better execute the PHP program, you can install the ZendOptimizer-2.6.0-Windows-i386.exe, this installation is very simple, here is not introduced.

Upgrade

Now the upgrade is very simple. You only need to download the new PHP Binary Package, delete the original c: \ PHP Directory, and decompress the new version to the C: \ PHP Directory, then restart IIS. You do not need to modify any configurations or copy any files to the System32 directory. Is it convenient?

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.