IIS6 + PHP the best configuration method

Source: Internet
Author: User
Keywords Network programming PHP tutorial
Tags .net asp asp.net binary configuration configure default directory

We all know that although the LAMP combination is a good choice, how to set up a web hosting server that supports PHP, ASP, ASP.NET, JSP, Perl, or IIS 6 with Windows 2003 is the best. There are many articles on the Internet to configure PHP articles on IIS 6, but those methods are not performance is not good, is to upgrade the trouble. The following method allows you to configure the first time, you can easily upgrade.
Upgrade here refers to the upgrade from one php4 version to another php4 version, or from a php5 version to another php5 version, rather than from php4 to php5.
ready:
1, a installed Windows 2003 server, and has installed IIS 6.
2, download the windows version of the PHP binary archive installation:
Unzip the PHP binary archive to the C: php directory (assuming C: drive is the system drive, the drive on which the Windows system is installed, and the D: drive on the system drive, unzip to the D: php directory Analogy, the same below).
Then open the "My Computer" -> Properties -> Advanced -> Environment Variables -> System Variables -> "path", edit its value, add the following path in front of the address:
C: php; C: phpdlls; C: phpextensions; C: phpsapi;
Copy php.ini-dist or php.ini-recommended to the C: Windows directory and rename it to php.ini, and generally publish the site's server with php.ini-dist, and use it as a debug server with php.ini -recommended better. Of course, under normal circumstances, this php.ini still need to be modified according to the actual situation.
Here are some of the necessary changes to introduce the following options:
extension_dir = "C: phpextensions"
This is the directory where the PHP extension is placed, just make sure it's the same directory that 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
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_xslt.dll
extension = php_yaz.dll
extension = php_zip.dll
Above, the beginning of the absence of a semicolon is the expansion of open, the semicolon is not open expansion. The above settings include opening all extensions (listed here is php 4) on Windows 2003 by default.
session.save_path = c: sessions

This is the default save session file directory, the directory must be an existing directory, otherwise the default session function will be invalid. I set here is a directory on a ramdisk. Set session.save_path on ramdisk to speed up session processing. If you do not have ramdisk installed, you can assign it to any of the other directories, such as the C: sessions directory, C: WindowsTemp directory, and so on.

OK, the basic work is done, and now the configuration IIS.

Open "Internet Information Services (IIS) Manager" in the "Web Services Extensions", select "Add a new Web Service Extensions" extension can fill in the "PHP ISAPI Extensions", the required file selection: C: phpsapiphp4isapi. dll (if you are installing PHP5, here is C: phpsapiphp5isapi.dll, the same below), and set the extension status to allow.

Open the "Website" -> "Properties" -> "ISAPI Filter" -> "Add", the filter name can be filled in "PHP", the executable still choose C: phpsapiphp4isapi.dll.

Open "Website" -> Properties -> "Main Menu" -> "Application Settings" -> "Configuration" -> "Application Extensions" -> "Add", the executable file or choose C: phpsapiphp4isapi.dll . Fill in the extension ".php", the action is limited to "HEAD, GET, POST".

Open "Site" -> Properties -> Documents -> Enable Default Content Documents -> Add, you can add index.php as the default content document.

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

test

In the default web site release directory, create a test page:

Download: phptest.php

phpinfo ();

?>

If you open this page to see php installation configuration information, even if the installation is successful.

If you want to optimize the implementation of the php program, you can install ZendOptimizer-2.6.0-Windows-i386.exe, the installation of this thing is very simple, not introduced here.

upgrade

Now it's easy to upgrade. Only need to download the new version of PHP binary compression package, delete the original C: php directory, extract the new version to C: php directory, and then restart the IIS on it. You do not need to change any configuration, nor do you need to copy any files to the System32 directory. Is not it convenient?

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